Theme function called incorrectly
webchick - July 24, 2009 - 21:02
| Project: | Google Ad Manager |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
hook_block op view looks like this:
<?php
$block = array(
'subject' => '',
'content' => theme_google_admanager_block($id, $ad_slot),
);
?>When you call a theme function directly, rather than going through theme('...'), it cannot be overridden through the theme system.
This line should be changed to:
<?php
'content' => theme('google_admanager_block', $id, $ad_slot),
?>
#1
Here's a patch.
#2
For some reason i got a rejection on this patch. Probably because i already patched it with the block cache patch webchick also submitted. I hand edited the file with the same change and it works correctly. marking RTBC
#3
correction, this is wrong. the module doesn't implement hook_theme, so though they are called theme_google_admanager_block(), they aren't going through the theme system. @webchick, do you have a patch that includes the theme function registrations?
#4
oops, changing the status needs work
#5
Find attached a new patch implementing the missing hook_theme. (update module against 6.x-1.x first before applying)
#6
Patch applied on 6-1 branch. Review requested with the 6.x-1.x-dev release.
#7
patch looks good here.
#8
Ok, I'll consider it fixed then since the patch was already applied to the CVS. If it's not ok yet, don't hesitate to reopen this issue.
#9
Automatically closed -- issue fixed for 2 weeks with no activity.