MR !2690 don't work as expected.
Tested in Drupal 11.
- Leaving one single item with - none shows error.
- Selecting two different image formats will merge both at the same srcset and the type attribute gets removed. This makes fallbacks useless.
Workaround for second issue:
Make individual <source>
items for every image format option.
Hacky workaround for image fallbacks using AVIF patch:
As Drupal 11 uses WebP by default, using
3202016
✨
Let GDToolkit support AVIF image format
Needs work
allow us to use AVIF images, then we create a copy of every image style but using AVIF (convert). In the current theme make an alternative breakpoint group with copies for every fallback, for example, X-Large (WebP) and X-Large (AVIF), Medium (WebP) and Medium (AVIF), it's important to set a weight to avoid headaches. This way, every fallback will get its own <source>
with type. We need to select a single style for every breakpoint to get this working.
material_base.inline_images.lg:
label: 'Large'
mediaQuery: 'all and (min-width: 1024px)'
weight: 6
mutipliers:
- 1x
group: material_base.inline_images
material_base.inline_images.lg_alt:
label: 'Large (alt)'
mediaQuery: 'all and (min-width: 1024px)'
weight: 5
mutipliers:
- 1x
group: material_base.inline_images
material_base.inline_images.md:
label: 'Medium'
mediaQuery: 'all and (min-width: 768px)'
weight: 4
mutipliers:
- 1x
group: material_base.inline_images
material_base.inline_images.md_alt:
label: 'Medium (alt)'
mediaQuery: 'all and (min-width: 768px)'
weight: 3
mutipliers:
- 1x
group: material_base.inline_images
...
alan delval → created an issue.
Tested but didn't work. It fails silently, headers on nodes text are missing.
My workaround to avoid filling logs, is decoding to " ".
This is a TOC API issue, not TOC Filter.
Did not work. Tested and found that works sometimes due to how HttpKernel works. The first request file is created and returns an instance of Response,
afterward it returns an instance of BinaryFileResponse
because the file already exists on file system.
// Since Drupal 10, assets are lazily constructed.
$sub_request = Request::create($asset['data']);
$raw_request = $this->httpKernel->handle($sub_request, HttpKernelInterface::SUB_REQUEST);
if ($raw_request instanceof \Symfony\Component\HttpFoundation\BinaryFileResponse) {
$css_request = $raw_request->getFile()->getContent();
}
else {
$css_request = $raw_request->getContent();
}
$css .= $css_request;
Patch works fine for responsive images, for CKEditor 5 is the easiest method right now. I was using Entity embed and it was just painfully slow.