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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3370958-5.patch | 2.62 KB | vuil |
| #2 | ImageFormatter_construct_error-3370958-2.patch | 2.18 KB | aalin |
Comments
Comment #2
aalin commentedPatch added
Comment #3
aalin commentedComment #4
vuilComment #5
vuilI can reproduce it too.
The patch of #2 does not work for me on Drupal 10.1 release. I post my patch here.
Comment #7
vuil@aalin Thank you very much about the issue creation.
The solution will be integrated in the new module release within a minute.
Comment #9
rmorelli commentedNot fixed in dev-2.0.x 2d422a9
PHP 8.2.18
regards
Comment #10
vuilI re-opened the issue.
Any suggestions?
Could you also paste your error message.
Thank you.
Comment #11
rmorelli commentedError message is the same but I finally solved using this merge request (never accepted)
https://git.drupalcode.org/project/formatter_suite/-/merge_requests/2/di...
Comment #12
vuilAlready resolved in the latest stable version. The issue is Fixed.