Line 98 on multiselect.module assumes there's always some nid associated with item,

so it'll give warning/error when entity reference is used.

CommentFileSizeAuthor
#2 multiselect-1864062-use_column_name-2.patch877 bytesJvE

Comments

jdleonard’s picture

Agreed. I think we need to check the field type and if it's an entity reference, use target_id instead of nid

JvE’s picture

Status: Active » Needs review
StatusFileSize
new877 bytes

Attached a patch to use the $value_key rather than nid.

anou’s picture

Title: nid is not available for target_id fields » Notice : Undefined index: nid in multiselect_field_widget_form() [nid is not available for target_id fields]

Hello,
I didn't saw your post (and patch) before doing this one. I did it for multiple issues and also for this one. I though to mention it here because I think it's related (not duplicate).

I changed the title because I think it's easier to find your post with the PHP error. Change it back if I'm wrong.
Cheers.

jdleonard’s picture

Status: Needs review » Reviewed & tested by the community

Patch makes sense and works as expected. Thanks!

mparker17’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

multiselect-7.x-1.x is no longer supported, because Drupal 7 is no longer supported.

Can you confirm if this is still an issue in multiselect-2.0.0-beta4?

I'm going to mark this issue as "Postponed (maintainer needs more info)"... but when you answer, please change it back to "Active". If there is no reply in ~6 months, then I will mark this issue as "Closed (outdated)". Thank you in advance for your understanding and patience as I try to keep this module's issue queue clear.