Problem/Motivation
I could be wrong about this but it appears that in ctools_block_content_type_render() if (empty($block)) is never true because just before it is $block = (object) $block; and therefore never returns early to prevent additional processing for an empty block.
The reason appears to be because as of PHP 5.0.0 "Objects with no properties are no longer considered empty".
source: http://php.net/manual/en/function.empty.php
function ctools_block_content_type_render($subtype, $conf) {
list($module, $delta) = _ctools_block_get_module_delta($subtype, $conf);
$info = _ctools_get_block_info($module, $delta);
$block = module_invoke($module, 'block_view', $delta);
if (!empty($info)) {
// Allow modules to modify the block before it is viewed, via either
// hook_block_view_alter() or hook_block_view_MODULE_DELTA_alter().
drupal_alter(array('block_view', "block_view_{$module}_{$delta}"), $block, $info);
}
$block = (object) $block;
if (empty($block)) {
return;
}
$block->module = $module;
http://drupalcontrib.org/api/drupal/contributions%21ctools%21plugins%21c...
Proposed resolution
Move the $block = (object) $block; to be just after (empty($block)).
Remaining tasks
Review patch below.
User interface changes
None.
API changes
None.
Comments
Comment #1
elijah lynnComment #4
mrjmd commentedI verified that this is indeed an issue. Reroll attached.
Comment #5
damienmckennaGood to go.
Comment #6
mrjmd commentedComment #8
japerryYup, works good for me too. Fixed!