- πΊπΈUnited States dave reid Nebraska USA
Dave Reid β made their first commit to this issueβs fork.
- πΊπΈUnited States dave reid Nebraska USA
I'm not able to replicate the issue, I have a site using Focal Point and I'm not seeing any fatal errors on the current 2.x branch.
- π«π·France duaelfr Montpellier, France
(I'll try to find time to reproduce that tomorrow. In the meantime I rerolled the MR)
- π«π·France duaelfr Montpellier, France
@Dave Reid Thank you for trying to reproduce. I found out that this has been fixed in the Focal point module by "chance" (D10 compatibility issue)
https://git.drupalcode.org/project/focal_point/-/commit/d6f8823#035115c4...I don't know if other image style extension modules have the same kind of issue or not but it seem safer to me to assume it could.
After digging a bit I now see two options:- Merge this MR as it is because it's kind of doing the same that Core does in
template_preprocess_image_style_preview()
- Use the
'#theme' => 'image_style_preview'
in your module instead of creating a custom preview so you don't have to worry about it anymore
What do you think?
- Merge this MR as it is because it's kind of doing the same that Core does in
- πΊπΈUnited States dave reid Nebraska USA
I'm torn about this because I think not providing the height and width is generally the default behavior for theme_image_style. There are several usages in core itself that do not do this:
\Drupal\media\MediaListBuilder::buildRow()
$row['thumbnail']['data'] = [ '#theme' => 'image_style', '#style_name' => 'thumbnail', '#uri' => $thumbnail_uri, '#height' => 50, // Note no #width attribute provided. ];
\Drupal\media_library\Form\AddFormBase::buildEntityFormElement()
$element['preview']['thumbnail'] = [ '#theme' => 'image_style', '#style_name' => 'media_library', '#uri' => $thumbnail_uri, ];
I also find many uses of this in contrib as well. I am tempted to say this was a bug in Focal Point that was resolved and not here, as this seems to be a fairly common use without providing them.
- Status changed to Closed: works as designed
8 months ago 8:51am 14 May 2024 - π«π·France duaelfr Montpellier, France
No need to keep that open :)
Thanks Dave!