Can't add new elements with autocomplete widget

Created on 30 June 2023, 12 months ago
Updated 22 August 2023, 10 months ago

Problem/Motivation

With the new version (3.1.0), a field with illimited values doesn't have anymore "Add an element" button in edit form with autocomplete widget, so i can't add multiple values, just one.
And existing values are deleted (except the first one) when i save content.

Steps to reproduce

Drupal 9.5.9.
Add a field with illimited values to a content type: i selected "France Regions" as source for testing because i use a custom source for my real field.
Select "External data source auto complete widget" in display form mode.
Try to edit a content: there is no button "Add an element".

Proposed resolution

Change annotation for autocomplete widget to use (back from V3.0.0) no multiple values, in src/Plugin/Field/FieldWidget/ExternalDataSourceAutoCompleteWidget.php, line 18
* multiple_values = FALSE

Remaining tasks

Make a patch

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇫🇷France Jejddx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024