- Issue created by @mrshowerman
- Merge request !43Make sure we always pass a URL object to the link render array. → (Closed) created by mrshowerman
- 🇩🇪Germany mrshowerman Munich
Closing this as it was decided to work on this in the original issue.
In some cases, linking an image can lead to a fatal error. This seems to be a regression from 🐛 Link missing on SVGs with responsive image formatter Active .
The error is caused due to inconsistent URL handling in the parent formatter: core's ResponsiveImageFormatter creates an object of type \Drupal\Core\Url
when the "Link image to" setting is set to "Content", but a string (as the result of $file->createFileUrl()
when it's set to "File".
As we take the URL from the parent formatter and use it in a link
render array, that fails with a string because it always expects a URL object.
Convert the string to a URL object.
Active
3.1
Code
Closing this as it was decided to work on this in the original issue.