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.

CommentFileSizeAuthor
#3 ctools_2092707.patch706 bytesyookoala
ctools.block_.inc_.patch382 bytesyookoala
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yookoala’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, ctools.block_.inc_.patch, failed testing.

yookoala’s picture

FileSize
706 bytes

A new patch. Hopefully it could pass the test system.

yookoala’s picture

Status: Needs work » Needs review

Hurrey! It passed! Can someone else help to test this?

Thanks!

merlinofchaos’s picture

Status: Needs review » Closed (fixed)

Your patch won't apply, because it's against 1.3 and not 1.x-dev where this problem has already been fixed.

yookoala’s picture

Good to hear that it is fixed :-)
Thanks!