The file_url_generator service is not passed to the class constructor

Created on 8 March 2023, over 1 year ago
Updated 16 October 2023, about 1 year ago

The AvatarFormatter class requires the file_url_generator service, but that is not passed to the class constructor.
The code must be changed to pass that service to the constructor.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇳China qiutuo

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

Comments & Activities

  • Issue created by @qiutuo
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇵🇭Philippines madelyncruz

    I've encountered the same issue in my Drupal 10 instance. It appears that there have been no modifications in the forked version, so I am including the patch here to resolve the issue in D10.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    + public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, EntityStorageInterface $image_style_storage, FileUrlGeneratorInterface $file_url_generator = NULL, PhpTransliteration $transliteration) {

    Parameters with a default value must be the last parameters.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India mrinalini9 New Delhi

    Updated patch #3 by addressing #4, please review it.

    Thanks!

Production build 0.71.5 2024