Closed (fixed)
Project:
Imagefield Gallery
Version:
5.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Apr 2008 at 20:22 UTC
Updated:
18 May 2008 at 16:23 UTC
Hi,
I tried overriding this function:
function theme_imagefield_gallery_lightbox2_css_render($type)
with my own function:
function phptemplate_imagefield_gallery_lightbox2_css_render($type)
but the override did not work.
After scratching my head, I noticed that problem is in the calling function:
function theme_imagefield_gallery_css_render()
The theme function is getting called called directly:
theme_imagefield_gallery_lightbox2_css_render($type)
rather than indirectly:
theme(imagefield_gallery_lightbox2_css_render$type)
I changed the calling function as follows and the override is now working:
function phptemplate_imagefield_gallery_css_render() {
$output = "
/* This CSS File is automatically generated by the imagefield_gallery.module, any
edits made to this file will be overwritten the next time any configuration changes
are made via the admin. If you'd like to alter the contents of this file, check
theme_imagefield_gallery_css_render() in the imagefield_gallery.module file. */
";
$types = imagefield_gallery_nodetypes();
foreach ($types as $type) {
$s = 'imagefield_gallery_'. imagefield_gallery_gallery_type($type['type']) .'_css_render';
$theme_func = 'theme_' . $s;
if (function_exists($theme_func)) {
$output .= theme($s, $type['type']);
}
/* original version:
$theme_func = 'theme_imagefield_gallery_'. imagefield_gallery_gallery_type($type['type']) .'_css_render';
if (function_exists($theme_func)) {
$output .= $theme_func($type['type']);
}
*/
}
return $output;
}
Anyway, thought I would let you know in case you wanted to add this fix to the source code.
- Mindy
Comments
Comment #1
eclipsegc commentedMindy,
Nice catch, I'll add this to the list for the next version.
Comment #2
eclipsegc commentedThis is fixed as of version 1.4
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.