At the block_view function a formatted html is returned.

Better would be if the $block['content'] is set to the unprocessed render array. In that way the content is better to alter by a hook_block_alter function.

I have a situation where I want to display only the form, no previous entered comments.

I tried this, and the comments are rendered also if the content part of the array is a render array.

Please! Have this in the next version :-)
Thanks!

CommentFileSizeAuthor
#1 Selectie_044.png21.14 KBerlendoos
Selectie_043.png63.42 KBerlendoos

Comments

erlendoos’s picture

StatusFileSize
new21.14 KB

A sideeffect - it is now shown as empty block at each page....

a check for !empty($content['comments']) is needed to solve this

torotil’s picture

Status: Active » Closed (duplicate)

Marking this as a duplicate of #1952438: Strict warning: Only variables should be passed by reference in commentsblock_block_view() (line 98 of because I've just posted a patch there that also fixes this issue.