The crop-context query parameter contains non-scalar values

Created on 26 February 2024, 10 months ago
Updated 20 March 2024, 9 months ago

Problem/Motivation

When no applicable image styles exist, an array of just `[null, null, null, ...]` is returned in ContextualImagecropMediaLibraryWidget.php at the lines 45-49:

if ($image_styles = $this->getImageStyles($items->getEntity())) {
  foreach ($image_styles as $image_style) {
    $crop_types[] = $this->getCropType($image_style);
  }
}

Steps to reproduce

Only select image styles without cropping effects

Proposed resolution

Put an array_filter() around the `$crop_types` array, and return early if the array is empty after that.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium RandalV

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

Comments & Activities

Production build 0.71.5 2024