Drupal 10 ImageFormatter::__construct error

Created on 28 June 2023, over 1 year ago
Updated 3 May 2024, 8 months ago

Problem/Motivation

In Drupal 10 ImageBase64Formatter field formatter is triggering the error:
ArgumentCountError: Too few arguments to function Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter::__construct(), 9 passed in /app/docroot/modules/contrib/image_base64_formatter/src/Plugin/Field/FieldFormatter/ImageBase64Formatter.php on line 66 and exactly 10 expected in Drupal\image\Plugin\Field\FieldFormatter\ImageFormatter->__construct() (line 75 of /app/docroot/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php).

Steps to reproduce

In drupal 10 clean install render an image using image_base64 field formatter

Proposed resolution

Add missing FileUrlGeneratorInterface $file_url_generator parameter for ImageFormatter::__construct

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇷🇴Romania aalin

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

Comments & Activities

Production build 0.71.5 2024