In the function ctools_block_content_type_admin_info() (line 291, ctools/plugins/content_types/block/block.inc), it assumed that $block->content would be a string. This is a wrong assumption. According the API documentation page:
content: The content of the block's body. This may be a renderable array (preferable) or a string containing rendered HTML content. If the content is empty the block will not be shown.
When $block->content is a renderable array, the line 291 will cause fatal error: could not be converted to string in filter_xss(). Since Panels is using ctools for the interface, this bug has implications to other module. For example:
To fix this, `$block->content` should be checked (and in some case rendered) before filter.
I've attached a patch to `ctools/plugins/content_types/block/block.inc`. The patch should fix the bug.
Comment | File | Size | Author |
---|---|---|---|
#3 | ctools_2092707.patch | 706 bytes | yookoala |
ctools.block_.inc_.patch | 382 bytes | yookoala |
Comments
Comment #1
yookoala CreditAttribution: yookoala commentedComment #3
yookoala CreditAttribution: yookoala commentedA new patch. Hopefully it could pass the test system.
Comment #4
yookoala CreditAttribution: yookoala commentedHurrey! It passed! Can someone else help to test this?
Thanks!
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedYour patch won't apply, because it's against 1.3 and not 1.x-dev where this problem has already been fixed.
Comment #6
yookoala CreditAttribution: yookoala commentedGood to hear that it is fixed :-)
Thanks!