Typehinting introduces errors

Created on 8 August 2024, 8 months ago
Updated 27 August 2024, 8 months ago

Problem/Motivation

transformDimensions() may be invoked with dimensions which are (incorrectly ?) provided as numeric strings (e.g. "250") instead of actual numvers.

Since https://www.drupal.org/node/3456203 introduced the strict_types requirement, this causes errors like this one.

Steps to reproduce

Uncertain. This happened after an upgrade from 3.x. Looking at the stack trace, we see that the numeric strings do not come from the style config object, but from the actual dimensions of the file passed to the style (in this case 07-sliceF-TB_0.png is 539x260 pixels, check here).

Proposed resolution

Make the code more resilient to auto-converge to correct types, by casting dimensions to int when getting them from the $dimensions array.

Remaining tasks

TBD.

User interface changes

None.

API changes

None.

Data model changes

Probably none.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇫🇷France fgm Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024