I ran into this problem:

#1048774: Node reference & multiple values

and noticed that the statically cached $fetched_nodes array is overwritten rather than appended to on successive calls to node_reference_field_prepare_view(). Shouldn't we be concatenating new values onto the $fetched_nodes array so that new nodes are merely added to the array rather than replacing it?

CommentFileSizeAuthor
#1 concatenate_fetched_nodes-1081638.patch922 bytescfennell

Comments

cfennell’s picture

Status: Active » Needs review
StatusFileSize
new922 bytes

Attached is the smallest patch I'll probably ever submit - just added the array merge += operator on $fetched_nodes to add previously cached nodes to the array. Thanks for looking into this.

yched’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense. There is a @todo note about whether the static is actually needed, but as long as it's there, we should definitely append to it rather than overwrite.

I'm not where I can commit right now, but RTBC.

yched’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Nice catch, cfennel !

cfennell’s picture

@yched Thanks :D

cfennell’s picture

@yched Thanks :D

Status: Fixed » Closed (fixed)

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