SvgImageUrlFormatter parent construct missing arguments 10 needed 9 passed.

Created on 21 September 2023, about 1 year ago
Updated 13 October 2023, about 1 year ago

Problem/Motivation

After upgrading to D10 and svg_image to 3.0.1 I was getting a below mentioned error
Too few arguments to function Drupal\image\Plugin\Field\FieldFormatter\ImageUrlFormatter::__construct(), 9 passed in /var/www/html/docroot/modules/contrib/svg_image/src/Plugin/Field/FieldFormatter/SvgImageUrlFormatter.php on line 41

Steps to reproduce

Step 1. On D10 install and enable svi_image 3.0.1 version module.
Step 2. Create a view and a svg filed with image_url field formatter.
Step 3. Visit the view or you may face problem even while adding field with a field formatter set to image_url while create the view it self.

Proposed resolution

It was found that to the parent constructor one argument FileUrlGeneratorInterface $file_url_generator was missed, hence added that argument and it resolved the issue.

🐛 Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

🇮🇳India tdnshah

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

Comments & Activities

Production build 0.71.5 2024