Closed (fixed)
Project:
Entity Embed
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
12 Nov 2015 at 21:41 UTC
Updated:
8 Jul 2019 at 20:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
slashrsm commentedComment #3
sluceroI'm seeing this issue as well. See attached images for screenshots of the issue.
Comment #4
sluceroComment #5
dshields 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 , but removing it from #2577891: Entity Embed 8.x-1.0.0-rc1 release.
Comment #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
@EntityEmbedDisplayplugins 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.
@EntityEmbedDisplayplugins 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 examplealtmay be overridden both when formatting animageMediaentity's image directly and when viewing animageMediaitem 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_overridedoes 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🚢