I always got this Error when some content will be referenzed by node_reference:
Undefined index: nid in node_reference_field_formatter_view() (line 481 of [..]/sites/all/modules/_basic/references/node_reference/node_reference.module)
My Solution was the following in node_reference.module:
427:
- $node = $item['node'];
+ //$node = $item['node'];
+ $node = isset($item['node']) ? $item['node'] : node_load($item['nid']);
477:
- $nodes_display[$item['nid']] = $item['node'];
+ $node_object = node_load($item['nid']);
+ $nodes_display[$item['nid']] = $node_object;
Now all works again. If some other has the same problem hope this will help!
Comments
Comment #1
kleinmp commentedI am running into this same issue. It's a little more sinister than an undefined index as noted in #2016021: EntityMalformedException when previewing node with node reference field :
Here's a patch for the dev version of the module (similar to comment 1).
Comment #2
jenlamptonI don't think this needs to be ported, changing status.
Also, could someone please add steps to reproduce, and possibly PHP version too?
Comment #3
renatog commentedHi people.
I applied the patch manually and works good for me.
Thank you very much for contribution.
Regards.
Comment #5
renatog commentedFixed.
Commited in dev branch.
Good Work and Good Weekend.
Regards.