Closed (works as designed)
Project:
Style Guide
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Jan 2022 at 15:19 UTC
Updated:
14 May 2024 at 08:51 UTC
Jump to comment: Most recent
Comments
Comment #3
duaelfrComment #5
dave reidI'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.
Comment #6
duaelfr(I'll try to find time to reproduce that tomorrow. In the meantime I rerolled the MR)
Comment #7
duaelfr@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:
template_preprocess_image_style_preview()'#theme' => 'image_style_preview'in your module instead of creating a custom preview so you don't have to worry about it anymoreWhat do you think?
Comment #8
dave reidI'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()\Drupal\media_library\Form\AddFormBase::buildEntityFormElement()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.
Comment #9
duaelfrNo need to keep that open :)
Thanks Dave!