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

das-peter’s picture

It 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

bojanz’s picture

Status: Active » Fixed

I 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.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Clarify that the issue has nothing to do with the mentioned patch.