SvgImageWidget should inherit from ImageWidget instead of FileWidget

Created on 8 February 2024, 5 months ago
Updated 21 May 2024, about 1 month ago

Problem/Motivation

Inheriting from FileWidget instead of ImageWidget breaks a few modules like https://www.drupal.org/project/decorative_image_widget β†’

And I'm not sure it's a very good idea to duplicate all the code of the ImageWidget from Drupal core.

We must keep in mind that we totally replace the core ImageWidget by our own SvgImageWidget implementation for all image types.

So we better keep as close as possible from the original ImageWidget implementation in my point of view.

Steps to reproduce

Activate the SVG Image module and add an image field.

Proposed resolution

Inherit from ImageWidget instead of FileWidget and override only what is strictly necessary.

EDIT:

Have also integrated the suggested changes from this issue: https://www.drupal.org/project/svg_image/issues/3413668 πŸ“Œ Replace upload validators with new ones introduced in Drupal 10.2 Needs work

MR have been successfully tested on Drupal 9.5.11 and 10.2.3.

πŸ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

πŸ‡«πŸ‡·France mably

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024