hook_node_view() accepts a $node object, which in PHP5 is automatically passed by reference - therefore the hook implementation should operate on the object directly, and not return anything. This behaviour is described in the hook_node_view() example implementation.

node_build_content() tries to assign the return value of the hook to its local copy of the node object, which should be NULL. Obviously, this doesn't work.

CommentFileSizeAuthor
#1 node_build_content.patch845 bytesrandomblast

Comments

randomblast’s picture

Status: Needs work » Needs review
StatusFileSize
new845 bytes

Simple fix. Should apply cleanly to D8 as well.

randomblast’s picture

Status: Needs review » Closed (works as designed)

Nope. hook_view()