Problem/Motivation

I recently upgraded to the latest version of nodeblock and when I tried to edit a panel I had a PHP Fatal error.
The Cause was that the block content returned by the hook_block_view in the nodeblock module is not a string but a Drupal renderable array. Through the module ctools and his function ctools_block_content_type_admin_info(), this "array content" is passed to the function filter_xss_admin() wich is waiting for a string parameter. This generate the fatal error.

Proposed resolution

Just before the return of the nodeblock function nodeblock_block_view(), I propose to generate the block render string in the property used by the ctools function named before to call the filter_xss_admin() function.

CommentFileSizeAuthor
nodeblock.module.patch566 bytesbarduck007
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vegardjo’s picture

Very timely! Got the same error when trying to add a nodeblock to a panel and a mini panel, and this patch solved it just fine! :)

Johnny vd Laar’s picture

Hmm:

http://api.drupal.org/api/drupal/modules%21block%21block.api.php/functio...

content: The content of the block's body. This may be a renderable array (preferable) or a string containing rendered HTML content.

So it shouldn't be a problem that this function returns a renderable array. I'll investigate.

Johnny vd Laar’s picture

Status: Active » Closed (won't fix)

This is a bug in the ctools module:
http://drupal.org/node/1925018

it looks like you can fix it by updating to the latest dev release.

barduck007’s picture

@Johnny vd Laar: Thanks for your search! The fix for Ctools module works fine.

dkumawat3’s picture

Perfect...! Thank you very much for the patch.