Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In node.module, node_block_view does not use render arrays in creating the rss and recent content blocks.
This issue is in response to #1034248: hook_block_view example should return a render array, specifically comments #2 and #20. It doesn't affect any functionality, just brings the code in line with D7+ best practices.
Will be along soon with patch.
Comment | File | Size | Author |
---|---|---|---|
#1 | node_render_array-1174602-1.patch | 1.42 KB | jn2 |
Comments
Comment #1
jn2 CreditAttribution: jn2 commentedHere's the patch. Rolled against D8, but should work as well for D7.
Comment #2
droplet CreditAttribution: droplet commentedOkay. Looks pretty.
Comment #3
Dries CreditAttribution: Dries commented#1: node_render_array-1174602-1.patch queued for re-testing.
Comment #4
Dries CreditAttribution: Dries commentedI tried to apply this patch against my 8.x branch, but it didn't apply cleanly. Asking for a re-test.
Comment #5
catch#1: node_render_array-1174602-1.patch queued for re-testing.
Comment #6
xjmTagging issues not yet using summary template.
Comment #7
Dries CreditAttribution: Dries commentedCommitted to 8.x and 7.x. Thanks.
Comment #8
Eric_A CreditAttribution: Eric_A commentedIf implementations of hook_block_view_alter(), hook_block_view_node_syndicate_alter() and hook_block_view_node_recent_alter() are going to receive different render structures from 7.9 onwards this needs to be documented before the next D7 release. But really, is this worth the risk of the possible headache for D7 contrib?
Comment #9
catchRe-opening against 7.x, not sure if the backport was intentional.
Comment #10
webchickRight, this change would suddenly break D7 modules using hook_page_alter() too.
Rolled back change in 7.x, unless Dries indicates this BC breakage was intended. But this just looks like a "would be nice" clean-up rather than a real bug to me.
Comment #12
xjmThis doesn't have a change notification but also the hook doesn't exist anymore in D8 and it was rolled back in D7, so nothing to do here!