Inject FileUrlGenerator via interface and not the class from core

Created on 22 August 2023, 10 months ago

Problem/Motivation

When this module is enabled together with drupal_decoupled the file_url_generator service is decorated and the error is thrown.

The website encountered an unexpected error. Please try again later.

TypeError: Drupal\simple_sitemap_extensions\Plugin\simple_sitemap\UrlGenerator\ExtendedEntityUrlGenerator::__construct(): Argument #14 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\lupus_decoupled_ce_api\File\FileUrlGenerator given, called in /app/web/modules/contrib/simple_sitemap_extensions/src/Plugin/simple_sitemap/UrlGenerator/ExtendedEntityUrlGenerator.php on line 119 in Drupal\simple_sitemap_extensions\Plugin\simple_sitemap\UrlGenerator\ExtendedEntityUrlGenerator->__construct() (line 66 of modules/contrib/simple_sitemap_extensions/src/Plugin/simple_sitemap/UrlGenerator/ExtendedEntityUrlGenerator.php). 

Proposed resolution

Use FileUrlGeneratorInterface in ExtendedEntityUrlGenerator instead of the service class.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇸🇮Slovenia useernamee Ljubljana

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

Comments & Activities

Production build 0.69.0 2024