When you use the autocomplete widget it only allows you to have one occurrence, regardless of whether you assign a multiple between 2 and 10 or select unlimited.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Status: Active » Closed (works as designed)

Ah, the field works like the taxonomy term selector, so rather than having multiple fields you just enter a comma after one and you are then able to add another.

DamienMcKenna’s picture

Title: "Autocomplete" widget only allows one occurrence » Change autocomplete widget to work like a nodereference autocomplete widget instead of a term autocomplete widget
Status: Closed (works as designed) » Active

Am re-focusing this so it works more like I was expecting - like a nodereference autocomplete widget instead of a term autocomplete widget.

DamienMcKenna’s picture

Title: Change autocomplete widget to work like a nodereference autocomplete widget instead of a term autocomplete widget » Change autocomplete widget to work like a nodereference widget

Shortened the title.

Damien Tournoud’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Category: bug » feature

Thanks for this report. This would mean removing the custom behavior for multiple values. I'm not against this, but I would like to hear more opinions about this.

maverick619’s picture

I agree. Adding multiple references in a 'tagging' style is not ideal in most situations. Would much prefer the old 'Add more' button which is used in D6.

maverick619’s picture

Status: Active » Needs review
FileSize
4.71 KB

Here is a patch which takes the multiple value functionality from the core field module and integrates it to work with the entity reference field.

DamienMcKenna’s picture

+1 for the patch in #6, it works as advertised.

maverick619’s picture

Turns out it doesn't actually save the fields. Here's an update. Should be good now :)

Damien Tournoud’s picture

Status: Needs review » Fixed
FileSize
8.87 KB

I wanted to keep both options, so I merged the following into 7.x-1.x (e09a585).

The upgrade path will take care of migrating the configuration, so nothing will change for existing sites, but the default widget is now this new autocomplete.

Status: Fixed » Closed (fixed)

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

BootstrapJohnny’s picture

I manually applied the patch from #9, but I still get the error on some fields, but not all. It appears that the "unlimited" number of references works, but the "1" reference field doesn't. Interesting note: I'm using Entity Reference Beta 2, but half of the patch was already there. Maybe this helps?