Fatal error when using SVG image widget

Created on 25 August 2023, over 1 year ago

Problem/Motivation

TypeError: Drupal\decorative_image_widget\DecorativeImageWidgetHelper::alter(): Argument #2 ($widget) must be of type Drupal\image\Plugin\Field\FieldWidget\ImageWidget, Drupal\svg_image\Plugin\Field\FieldWidget\SvgImageWidget given, called in /web/modules/contrib/decorative_image_widget/decorative_image_widget.module on line 48 in Drupal\decorative_image_widget\DecorativeImageWidgetHelper::alter() (line 94 of modules/contrib/decorative_image_widget/src/DecorativeImageWidgetHelper.php).

Steps to reproduce

Install and config svg_image module along with decorative image widget module

Proposed resolution

Issue is caused by implementation of hook_field_widget_single_element_WIDGET_TYPE_form_alter as part of https://www.drupal.org/project/decorative_image_widget/issues/3336325#co... Drupal 10 compatibility fixes Fixed

Need to include alter only when widget is instance of ImageWidget, similar to what has been added in decorative_image_widget_field_widget_form_alter

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India guptahemant

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

Comments & Activities

Production build 0.71.5 2024