Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When an entity is embedded and you quick edit the parent entity, the title field of the parent and the title field of the child are both editable (but not other fields). If you then click the title of the child entity it suddenly converts all of the text in the child to the same element as the title (H1).
If you quick edit the embedded child entity there is no issue, works just fine.
Comment | File | Size | Author |
---|---|---|---|
#17 | 2614364-17.patch | 5.04 KB | Wim Leers |
| |||
#17 | interdiff.txt | 2.22 KB | Wim Leers |
#17 | 2614364-17-test_only_FAIL.patch | 2 KB | Wim Leers |
#15 | 2614364-15.patch | 5.03 KB | Wim Leers |
| |||
#15 | interdiff.txt | 428 bytes | Wim Leers |
Comments
Comment #2
slashrsm CreditAttribution: slashrsm as a volunteer commentedComment #3
sluceroI'm seeing this issue as well. See attached images for screenshots of the issue.
Comment #4
sluceroComment #5
dshields CreditAttribution: dshields at Canadian Blood Services commentedThis is still an active issue.
Comment #6
Wim LeersReproduced.
This actually looks like a bug in Quick Edit in Drupal core. It indeed only affects title fields of embedded entities. I vaguely recall that Quick Edit had to special case those … but obviously got something wrong in the logic! Will need to do some JS debugging to figure this out.
Also, FYI: #3011228: Missing `data-quickedit-entity-id` attribute prevents in-place editing of embedded entities's patch solves that issue, but does not help fix this.
Comment #7
Wim LeersUpdating the title to explicitly communicate that this is indeed a core bug.
Comment #8
Wim LeersI cannot reproduce this when embedding media entities, which is the most common use case for
entity_embed
.Keeping this marked as #2577891: Entity Embed 8.x-1.0.0-rc1 release.
, but removing it fromComment #9
Wim LeersI suspect I may have been testing #2940029: Add an input filter to display embedded Media entities when I wrote #8.
Quoting #2940029-38: Add an input filter to display embedded Media entities:
Comment #10
Wim LeersComment #11
Wim LeersThis is ported as close as possible from #2940029: Add an input filter to display embedded Media entities's patch. I think this will cause some test failures though because it is running for all
@EntityEmbedDisplay
plugins right now, rather than only the view mode-based one. I'll fix that tomorrow :)Comment #12
Wim LeersAssigning to me; I'll continue tomorrow.
Comment #14
Wim LeersReverted changes that #11 made to
EntityEmbedBuilder
, because like #11 predicted, it caused problems elsewhere.Also, this took me multiple hours to figure out.
@EntityEmbedDisplay
plugins building on top of formatters in core and being derived and being configurable made this super complex — at least for me.Comment #15
Wim LeersGreen again — yay :)
Confusingly, #9 passed tests. It should not have. And actually … it did not. This is DrupalCI's reporting being flaky.
At https://www.drupal.org/pift-ci-job/1329534 you can see the last daily test run against the HEAD of the branch. 88 passes. #9 is adding a new test, and yet still only 88 passes. This means the new test was not executed.
And sure enough:
Note the absence of
\Drupal\Tests\entity_embed\Kernel\EntityEmbedFilterDisabledIntegrationsTest
. Same in #14.Looks like the class name doesn't match the filename, that probably caused it.
Comment #16
oknateI'm not sure about this:
Isn't it possible that there are other plugins that render the entity that don't have that plugin id? Should we allow other plugins to opt to what comes after the return statement here? Could we check if it inherits from the base class instead?
For the alt and title we added another attribute, $definition['supports_image_alt_and_title']), perhaps we should follow a similar approach here?
$definition['renders_entity']) or something like that.
Comment #17
Wim LeersAh, 91 tests passed — this time it worked! :)
Now let's fix the sole coding standards violation and upload a fail/pass patch.
We want to do this whenever a view mode/
EntityViewDisplay
-powered representation of an entity gets rendered, because that's where contextual links and Quick Edit may appear.That's an important difference with
supports_image_alt_and_title
, where for examplealt
may be overridden both when formatting animage
Media
entity's image directly and when viewing animage
Media
item in whichever view mode.However … it's possible that contrib modules are subclassing the existing formatter to layer on special behaviors. Turns out for example
entity_reference_override
does this!Fortunately there's a reliable way to detect whether a render array is generated by
EntityViewBuilder
, which is really what we're after.Comment #19
Wim LeersI think #17 is ready :)
Also: there's nothing upstream-related nor JavaScript-related here anymore, so updating title and tags.
Crediting everybody who participated in this issue 🙏
Comment #21
Wim Leers🚢