The entity-embed-container.html.twig template doesn't seem to be producing the necessary "data-quickedit-entity-id" attribute causing a JS error. Attached is a patch which has resolved this for me.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mr.les created an issue. See original summary.

leslie.cordell’s picture

leslie.cordell’s picture

leslie.cordell’s picture

wim leers’s picture

wim leers’s picture

Title: Missing QuickEdit attributes » Missing `data-quickedit-enitty-id` attribute prevents in-place editing of embedded entities
Status: Active » Needs work
Issue tags: +Usability

This patch works. But it's duplicating logic from quickedit_entity_view_alter(). Ideally, we'd be able to not do this and just have quickedit_entity_view_alter() do this for us. I wonder if we can change Entity Embed's rendering logic instead (in \Drupal\entity_embed\EntityEmbedBuilder::buildEntityEmbed() I'm guessing?).

wim leers’s picture

Title: Missing `data-quickedit-enitty-id` attribute prevents in-place editing of embedded entities » Missing `data-quickedit-entity-id` attribute prevents in-place editing of embedded entities

Typo 😅

wim leers’s picture

Status: Needs work » Closed (works as designed)
Issue tags: +BarcelonaMediaSprint

Uhm, actually, this already works fine in HEAD without this patch. This only works when using one of the "view mode" @EntityEmbedDisplay plugins, because those have actually been rendered through the usual entity rendering pipeline.

hershy.k made their first commit to this issue’s fork.

hershey.k’s picture

I'm still seeing this patch being necessary in my use case when using output from the modules/contrib/entity_embed/templates/entity-embed-container.html.twig template within a paragraph field.

In my use case, I'm using the paragraph entity embed module as the entity embed is within a paragraph field, but I am not sure if this is the cause specifically for this issue or not.

See below output screenshots without patch and with patch from merge request https://git.drupalcode.org/project/entity_embed/-/merge_requests/16

Missing attribute error:
error
markup

Correct output:
correct markup

hershey.k’s picture

Status: Closed (works as designed) » Needs review
hershey.k’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev