exactly as noted in the readme, i have added the following code to my theme's template.php file:
function q1000a_block($block) {
if (module_exists('blocktheme')) {
if ( $custom_theme = blocktheme_get_theme($block) ) {
return _phptemplate_callback($custom_theme,array('block' => $block));
}
}
return phptemplate_block($block);
}
for quite a while when i go to my manage blocks page i have been plagued by the following error: "warning: Invalid argument supplied for foreach() in /path/to/drupal/modules/block/block.module on line 161."
after a good deal of detective work, i think i've discovered that returning phptemplate_block($block); may be the culprit. if i remove it, then there is no error (although none of the non-blockthemed blocks are displayed either). i have checked and there are no other callbacks to phptemplate_block in the template.php file.
has anyone else run into trouble with this? is there any way to fix this error?
thanks for looking into this problem.
Comments
Comment #1
Anonymous (not verified) commentedDid you by any chance introduce a module named q1000a as well? In this case the function q1000a_block will be call as a module_hook as well which could explain your problems.
Comment #2
masande commentedbingo! that was exactly the problem. thanks for ending a problem that has persisted for months as an annoyance. i've learned not to name themes and custom modules the same thing.
Comment #3
masande commentedfixed and marking as closed...