Set entity selection widget cardinality to 1

Created on 9 April 2024, 3 months ago
Updated 25 April 2024, 2 months ago

Problem/Motivation

The current default behavior of all entity browser views opened by ckeditor5_entity_browser is to allow selection of multiple entities. I can't think of a case where we'd want to return multiple canonical links to single link instance in ckeditor 5. Indeed, if you select more than one, you get an error.

Steps to reproduce

  1. Open an entity browser via the ckeditor5_entity_browser button.
  2. Note that the entity browser selection widgets are all checkboxes.
  3. Select more than one entity and submit the form.
  4. The submission will fail with the error "Please select only one item."

Proposed resolution

Set the entity browser selection widget cardinality to one by default.

With that done, if you enable the 'Use field cardinality' option for the Entity browser bulk select form in your view, the checkboxes will become radio buttons and allow only a single selection. (It's probably worth documenting this requirement somewhere.)

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024