When I save a node having selected some entities, I get these warnings:

    Notice: Undefined index: add in entityreference_view_widget_validate() (line 493 of /Users/joachim/Sites/7-drupal/sites/all/modules/contrib/entityreference_view_widget/entityreference_view_widget.module).
    Warning: array_filter() expects parameter 1 to be array, null given in entityreference_view_widget_validate() (line 493 of /Users/joachim/Sites/7-drupal/sites/all/modules/contrib/entityreference_view_widget/entityreference_view_widget.module).
    Warning: Invalid argument supplied for foreach() in entityreference_view_widget_validate() (line 494 of /Users/joachim/Sites/7-drupal/sites/all/modules/contrib/entityreference_view_widget/entityreference_view_widget.module).

Comments

barry_fisher’s picture

I've just created a patch for this that basically avoids processing an empty $element_values['add'] array when all possible right hand side entities are selected (or if none exist). $element_values['add'] is basically non-existent in this case.

barry_fisher’s picture

Am I attaching this patch correctly?- it's been a while!! :)

7wonders’s picture

Seems to have worked for me.

pcambra’s picture

Status: Active » Needs review
bojanz’s picture

Status: Needs review » Fixed

Committed, thanks for the patch, reallifedesign!

Status: Fixed » Closed (fixed)

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