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.
While working on the port of the Entity Embed filter's test coverage to core in #2940029: Add an input filter to display embedded Media entities, I spotted a small problem in the missing entity indicator that #2982322: Mark missing embedded entities in WYSIWYG introduced. It's using file_create_url()
, but is not wrapping that in a call to file_url_transform_relative()
.
When not using file_url_transform_relative()
, the Entity Embed filter would have to vary by the url.site
cache context.
Comment | File | Size | Author |
---|---|---|---|
#2 | 3063837-2.patch | 1.94 KB | Wim Leers |
|
Comments
Comment #2
Wim LeersComment #3
oknateWhen you don't control the output, such as with imagefieldformatter, it will output a full url, for example line 99 of /tests/src/Functional/ImageFieldFormatterTest.php
http://my-local-test-site.local/sites/simpletest/15008825/files/image-test.png
I think in that case it's using a core template image.html.twig, if I remember correctly. So the entity embed filter would have to vary by the site.url for that, right?
Comment #4
Wim LeersNo, it's up to the formatter that the Entity Embed filter calls to associate that cache context. The file URL being generated in this particular case is the only file URL being generated by the Entity Embed filter, so this is the only case where it has that responsibility.
Comment #5
oknateOK, this change looks good to me, RTBC.
Comment #7
Wim Leers🚢