Ticket #142 (closed defect: fixed)
Themes don't work properly if they don't define filter functions
| Reported by: | rickc | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | Themes | Version: | SVN |
| Keywords: | themes, plugins, has_patch | Cc: |
Description
What I did: I placed calls to $theme->header() in my theme's header template, and $theme->footer() in my theme's footer template. I installed a plugin that defined a theme_footer( $theme ) function to output data in my theme's footer.
What I expected: The data to appear in my theme's footer.
What I got: The page display was either truncated or this error appeared on my login page:
Error: implode() [function.implode]: Invalid arguments passed /system/classes/theme.php : Line 517
I worked around the error by defining a basic filter_theme_call_footer() function in my theme:
function filter_theme_call_footer( $return, $theme ) {
return $return;
}
The same events occur with the header, except the reader is left staring at a blank page since anything in the body of the page is truncated. The fix is also the same, define a minimal filter_theme_call_header() function in the theme class.
It is my understanding that placing calls to $theme->header/footer/sidebar() in a theme's templates is supposed to allow plugins to define theme_header/footer/sidebar() and filter_theme_call_header/footer/sidebar() functions to output into the theme's templates or filter the information before it is output without having to define these filter functions in the theme class.
