Overview
Discovered in #3530351: Decouple image+video (URI) shape matching from specific image+video file types/extensions. This bug makes that MR harder to understand.
In HEAD, any image field instance's values populates a component instance with either its url property or its src_with_alternate_widths property. Both are computed from the value field property. The results are:
value=public://test.pngurl=/vfs://root/sites/simpletest/91669142/files/test.pngsrc_with_alternate_widths=/vfs://root/sites/simpletest/91669142/files/test.png?alternateWidths=/vfs%3A//root/sites/simpletest/91669142/files/styles/xb_parametrized_width--%7Bwidth%7D/public/test.png.webp%3Fitok%3DFEbY0Wjq
🐛 The bug: neither of those latter 2 are valid URLs!
Now, in principle the SDC JSON Schema validation should've complained about that. But due to a bug in the regex (JSON Schema pattern) of json-schema-definitions://experience_builder.module/image-uri, which turns out to have been too broad/liberal in what it accepts. 😬 That's part of what #3530351: Decouple image+video (URI) shape matching from specific image+video file types/extensions is fixing, but in order to keep the scope/MR clear there, this has been lifted out of there.
Proposed resolution
Ensure /vfs://root/sites/simpletest/91669142/files/test.png gets rewritten to a valid URL.
Core has prior art for this: \Drupal\Tests\system\Kernel\Theme\TwigIncludeTest::setUpFilesystem(). Use that.
User interface changes
None.
Issue fork experience_builder-3543805
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
Comment #3
wim leersComment #5
wim leers