It's possible to overflow the number of allowed items with edit selection

Created on 15 October 2020, almost 5 years ago
Updated 14 August 2025, 5 days ago

Problem/Motivation

Within the entity browser and multistep selection display, it's possible to select more than the cardinality. It would be better to prevent this so that it replaces your selection rather than add to it. So if you have cardinality 1 and select another item, it should replace the selection. If you have cardinality 2 and you select one, it should replace one of the two selected, not add a third.

https://www.drupal.org/files/issues/2020-10-15/weird-overflow.mov β†’

Steps to reproduce

Add an entity browser with Multistep selection display with cardinality 1 (or 2 or anything other than -1).

Select more than the allowed number of items. Rather than constraining the selection, it allows selecting and inserting more than the allowed amount. The extra items just disappear. If you have cardinality 1, this means you have to do an extra step of removing the selected item within the entity browser before selecting another.

Proposed resolution

Constrain the selection to the cardinality limit.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

2.0

Component

Widget plugins

Created by

πŸ‡ΊπŸ‡ΈUnited States oknate Greater New York City Area

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024