I have seen that this module is not tested against Entity Reference fields. I have created a group with two fields that have cardinality unlimited. One of the two fields is an entity reference field, with autocomplete input. It seems that the module works, however when I visit the new content form I get the following notices:
Notice: Undefined index: target_id in entityreference_field_widget_form() (line 821 of sites\all\modules\entityreference\entityreference.module)
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 173 of includes\entity.inc)
The warnings are not present when I visit the edit content form, maybe they appear when the fields are empty?
Comments
Comment #1
plessas CreditAttribution: plessas commentedComment #2
adamtong CreditAttribution: adamtong commentedi have same issue too!
Comment #3
nesse0 CreditAttribution: nesse0 commentedI have the same issue on add and edit forms. Entity reference fields are extremely common so I would think this is a fairly high priority issue.
Comment #4
nesse0 CreditAttribution: nesse0 commentedSo I've narrowed this down to an issue with entity reference fields with cardinality >1 that use the autocomplete widget.
I found a related issue over at the issue queue for the entityreference module: Entity Reference Error (array_flip, undefined target_id) when using autocomplete and no entites selected
Applying the patch in comment 3 from there resolved the issue for me.
Comment #5
alvar0hurtad0Great @nesse() !!
Yo you dare to write a patch?
;)
I promise correct author attribution.
:)
Comment #6
nesse0 CreditAttribution: nesse0 commentedalvar0hurtad0, I think the existing patch for the entity reference module is the solution rather attempting to resolve it within this module.