Route parameter $image_style upcast as entity in core 9.5

Created on 3 May 2023, about 1 year ago

Problem/Motivation

This module no longer works in core 9.5, the issue being the route parameter $image_style is now passed as an entity and not a string - this means any dynamic image style URLs serve a 404 since there's no defined image style entity with that ID.

Steps to reproduce

Upgrade to core 9.5, dynamic image styles serve 404 (even with empty allowed_image_styles config).

Proposed resolution

Attached patch uses a custom ParameterConverter to either load defined image styles or create a dynamic one before passing to the route controller.

NB the patch also contains changes made by patches in the issues to upgrade info file for D9 ( https://www.drupal.org/project/image_style_dynamic/issues/3139308 β†’ ), and to allow regex in allowed image styles config ( https://www.drupal.org/project/image_style_dynamic/issues/3223708 β†’ ).

Remaining tasks

QA.

πŸ’¬ Support request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada bgilhome Victoria

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

Comments & Activities

Production build 0.69.0 2024