If block content is created using a theme() call that does not take an argument, as in

$block['content'] = theme('amazon_store_search_block');

Then you get the E_NOTICE message:

Notice: Undefined index: render element in contextual_preprocess() (line 82 of modules/contextual/contextual.module).

The attached patch just checks for this situation and avoids it. The code already dealt with the situation of not having found an element.

CommentFileSizeAuthor
#1 drupal.contextual_no_theme_arg.patch590 bytesrfay

Comments

rfay’s picture

StatusFileSize
new590 bytes

Patch was lost. Seems to happen regularly these days.

kevin hankens’s picture

kevin hankens’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to me. This morning I added a custom contextual link to a block and this error showed up, I can see this being a pretty common scenario.

The patch works great and doesn't appear to cause any problems on my end.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.