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.

CommentFileSizeAuthor
#1 node_render_array-1174602-1.patch1.42 KBjn2
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jn2’s picture

Assigned: jn2 » Unassigned
Status: Active » Needs review
FileSize
1.42 KB

Here's the patch. Rolled against D8, but should work as well for D7.

droplet’s picture

Status: Needs review » Reviewed & tested by the community

Okay. Looks pretty.

Dries’s picture

#1: node_render_array-1174602-1.patch queued for re-testing.

Dries’s picture

I tried to apply this patch against my 8.x branch, but it didn't apply cleanly. Asking for a re-test.

catch’s picture

#1: node_render_array-1174602-1.patch queued for re-testing.

xjm’s picture

Tagging issues not yet using summary template.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x and 7.x. Thanks.

Eric_A’s picture

Issue tags: +Needs change record

If 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?

catch’s picture

Version: 8.x-dev » 7.x-dev
Category: task » bug
Status: Fixed » Reviewed & tested by the community

Re-opening against 7.x, not sure if the backport was intentional.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Right, 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xjm’s picture

This 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!