Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comments
Comment #1
DamienMcKennaAh, 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.
Comment #2
DamienMcKennaAm re-focusing this so it works more like I was expecting - like a nodereference autocomplete widget instead of a term autocomplete widget.
Comment #3
DamienMcKennaShortened the title.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedThanks 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.
Comment #5
maverick619 CreditAttribution: maverick619 commentedI 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.
Comment #6
maverick619 CreditAttribution: maverick619 commentedHere is a patch which takes the multiple value functionality from the core field module and integrates it to work with the entity reference field.
Comment #7
DamienMcKenna+1 for the patch in #6, it works as advertised.
Comment #8
maverick619 CreditAttribution: maverick619 commentedTurns out it doesn't actually save the fields. Here's an update. Should be good now :)
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedI 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.
Comment #11
BootstrapJohnny CreditAttribution: BootstrapJohnny commentedI 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?