I'm getting this error on a simple setup:

1. content-type image with field_image
2. content-type article with field_image_ref and widget reference_node_selector

CommentFileSizeAuthor
#2 nodereference_selector-1689218.patch972 bytesjonhattan

Comments

jonhattan’s picture

Assigned: Unassigned » jonhattan

If a create a new field and select this widget on creation it works.

It fails when editing the field.

I'm configuring the field for cardinality:unlimited (-1)

in function nodereference_selector_validate() you load the field widget and it's wrong as it doesn't provide the current cardinality of the field (filled in the form being submited).

jonhattan’s picture

Assigned: jonhattan » Unassigned
Status: Active » Needs review
StatusFileSize
new972 bytes
skein’s picture

Status: Needs review » Fixed

Hello,

Yes I managed to replicate the issue.

But applying your patch gives the following error:

Notice: Undefined index: field in nodereference_selector_validate() (line 138 of C:\xampp\htdocs\sandbox\sites\all\modules\nodereference_selector\nodereference_selector.module).

You selected more than allowed elements

But I've added a fix in the validation function to check for a positive number of allowed selections.
The fix is added in the latest dev snapshot.

skein’s picture

Status: Fixed » Closed (fixed)

  • Commit 1a1f50a on 7.x-1.x, 7.x-2.x by skein:
    Issue #1689218  by jonhattan: Added check for a positive number in the...