Hello,

On my site I get several notices when I use context:

Notice : Undefined property: stdClass::$content in _block_get_renderable_array()...

I have tried many solutions without success:
https://www.drupal.org/node/1306172#comment-10265695
https://www.drupal.org/node/2107877
...

Is there a method for debug these notices and resolve these messages?

Thanks for your help.

Comments

kumkum29 created an issue. See original summary.

kumkum29’s picture

Sometimes in my region some blocks are empty. The notices come from the empty blocks?
Is there a solution for not rendering a block if it is empty?

Here is my code to generate my region in the template.php:

	// Add the "myregion" region inside node
	if ($plugin = context_get_plugin('reaction', 'block')) {
		$variables['myregion'] = $plugin->block_get_blocks_by_region('myregion');
	}

Here is my code in my node.tpl:

<?php if (isset($myregion)) { ?>
	<?php print render($myregion); ?>
<?php } ?>

Thanks.

jief’s picture

I fix the same problem by adding drupal_static_reset('context_reaction_block_list'); after $variables['myregion'] = $plugin->block_get_blocks_by_region('myregion');

so

// Add the "myregion" region inside node
if ($plugin = context_get_plugin('reaction', 'block')) {
         $variables['myregion'] = $plugin->block_get_blocks_by_region('myregion');
         drupal_static_reset('context_reaction_block_list');
}
paulocs’s picture

Hi @kumkum29,
Maybe to late, but did you solve your problem with comment #3?

If you still have problem please reopen the issue.

paulocs’s picture

Status: Active » Fixed
paulocs’s picture

paulocs’s picture

Status: Fixed » Closed (fixed)