Hi,
When i work with entity_browser and entity_embed, i can select multiple entities to load in Ckeditor.
however, when I submit the entity_browser dialog after chosing my entities, entity_embed will handle the last selected entity and handle only this one.

If the entity browser allows selecting multiple entities , it must handle all of them.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BizuTétu created an issue. See original summary.

Mars0test’s picture

Renrhaf’s picture

I've encountered the same issue. I'm able to select many entities (of type media) in my entity browser but when I save the selection, only one of them is considered. However the patch does not seem to work for me, as there are many steps where only one entity can be considered.

Mars0test’s picture

Hy !
Sorry but I think with the many change of Drupal core and Entity Embed module this patch can't work. it work find for 8.2 if I remember :/

Status: Needs review » Needs work
Wim Leers’s picture

Component: CKEditor integration » User interface

Interesting! Either Entity Embed should instruct Entity Browser to restrict selection to a single entity or Entity Embed should effectively create one <drupal-entity data-entity-uuid="…" …> tag for every selected entity.

Wim Leers’s picture

Title: Entity_embed does not charge multiple entity » Entity Embed does not embed all entities selected in Entity Browser
Issue tags: +Media Initiative
Wim Leers’s picture

Title: Entity Embed does not embed all entities selected in Entity Browser » [entity_browser] When selecting multiple entities, only the last one is inserted
Wim Leers’s picture

Title: [entity_browser] When selecting multiple entities, only the last one is inserted » [entity_browser] [upstream] When selecting multiple entities, only the last one is inserted
Issue tags: -Media Initiative +Usability
Related issues: +#2767573: [Follow-up] Use Entity browser's form element

Actually, \Drupal\entity_embed\Form\EntityEmbedDialog::buildSelectStep() contains:

        '#cardinality' => 1,

Which #2767573: [Follow-up] Use Entity browser's form element introduced. Either it wasn't properly tested there, or entity_browser broke something.

The Media Initiative doesn't depend on Entity Browser anymore (with Media Library in core), so untagging for that.

Wim Leers’s picture

Title: [entity_browser] [upstream] When selecting multiple entities, only the last one is inserted » [entity_browser] Allows selecting multiple entities despite #cardinality = 1 — either insert multiple entities or respect single cardinality