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.
Comment | File | Size | Author |
---|---|---|---|
nodeblock.module.patch | 566 bytes | barduck007 |
Comments
Comment #1
vegardjo CreditAttribution: vegardjo commentedVery 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! :)
Comment #2
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedHmm:
http://api.drupal.org/api/drupal/modules%21block%21block.api.php/functio...
So it shouldn't be a problem that this function returns a renderable array. I'll investigate.
Comment #3
Johnny vd Laar CreditAttribution: Johnny vd Laar commentedThis 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.
Comment #4
barduck007 CreditAttribution: barduck007 commented@Johnny vd Laar: Thanks for your search! The fix for Ctools module works fine.
Comment #5
dkumawat3 CreditAttribution: dkumawat3 commentedPerfect...! Thank you very much for the patch.