Problem/Motivation
- #3059480: Embedded media entities using a view mode have captions that look broken introduced the
entity_embed/captionasset library and attaches it automatically. - It cannot be attached only when the
@Filter=filter_captionfilter is enabled, because filters do not know which other filters run - Therefore it must always be attached when
@Filter=entity_embedrenders an embedded entity - … but today it doesn't check that rendering an embedded entity actually resulted in something being rendered; an entity inaccessible to the current user renders to the empty string and hence there's also no caption, so also no need to attach the asset library.
(Discovered this while working on #3052482: Expand EntityEmbedFilter's test coverage: test many more edge cases, change to kernel test.)
Proposed resolution
Only attach the entity_embed/caption asset library when there actually is an embedded entity.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3063801-5.patch | 3.12 KB | wim leers |
| #5 | interdiff.txt | 2.21 KB | wim leers |
| #4 | 3063801-3.patch | 2.18 KB | wim leers |
| #4 | interdiff.txt | 1.08 KB | wim leers |
| #2 | 3063801-2-FAIL.patch | 1.15 KB | wim leers |
Comments
Comment #2
wim leersComment #3
wim leersComment #4
wim leersLet's make it happen.
Comment #5
wim leersLet's not hardcode knowledge about the expectations in the test method, that's what the data provider is for!
Comment #7
wim leersGreen, simple, 🚀
Comment #9
wim leers