Closed (fixed)
Project:
Entity Reference View Widget
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Oct 2011 at 11:00 UTC
Updated:
27 Oct 2011 at 18:40 UTC
First thank you very much for this awesome widget! :)
I just came across this notice:
Notice: Undefined index: node in entityreference_view_widget_field_widget_form() (line 298 of entityreference_view_widget.module).
This is caused by the fact that node_view_multiple() stores the entities to return in an array with the keyed by "nodes" instead "node" ($build['nodes']).
Thus we can't access these by using the entity type - current code in entityreference_view_widget_field_widget_form() :
$entity_view = $entity_view[$entity_type];
I'm not sure if reset($entity_view) would be an appropriate way of accessing the results :|
Is there any chance that there are multiple keys?
Attention: It could be that this issue is a side effect of using this patch #1266036: Add generic Views entity tables with fields and relationships
Comments
Comment #1
das-peter commentedIt looks like the mentioned patch has nothing to do with the actual problem.
Thus I opened a separate Issue for Entity API: #1306906: Ensure entity_view() works as documented and has a unified return value
Comment #2
bojanz commentedI went with the hack for now: http://drupalcode.org/project/entityreference_view_widget.git/commitdiff...
There's no way for that array to have more than one element, so it's okay.
Comment #3.0
(not verified) commentedClarify that the issue has nothing to do with the mentioned patch.