Full error message:
Notice: Undefined index: field_name in entityreference_view_widget_validate() (line 465 of entityreference_view_widget/entityreference_view_widget.module).

This error occurs when the field is grouped using the http://drupal.org/project/field_group module.

A patch is posted below which checks if the field is grouped.

Comments

tseven’s picture

stockliasteroid’s picture

I'm not using field group, but I am using this module to set a reference on a profile2 entity and I saw the same error. Installing this patch took care of it, thanks a lot!

stella’s picture

StatusFileSize
new11.79 KB

I have a similar problem but I'm not using the field_group module, but I am using the field_collection module. If I edit an entity reference field (using the entityreference_view_widget) which is inside a field_collection directly at the field collection url (e.g. /field-collection/field-collection-field-name/XXX/edit) then it works fine. However, if I try to edit it within the node form, then I get the above errors. In addition, the views pager doesn't work and the add and remove checkbox ajax functionality doesn't work.

The attached patch should address all of the above issues. It should work for both field collections and field groups, though admittedly I haven't tested it with field groups. In addition, it should handle with more complex setups - for example, in one instance I have an entityreference_view_widget inside a field collection which is inside yet another a multi-value field collection.

chrlvclaudiu’s picture

has anyone tested the above patch ?
i see lots of warnings after applying it.

thanks.

bojanz’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

This is too big of a change for the 1.x branch which is now frozen.
Please test the 2.x branch and submit a new patch if the problem still exists there.