Type error when installing the storybook module

Created on 25 August 2024, 3 months ago
Updated 4 September 2024, 3 months ago

Problem/Motivation

The module throws a type error in a construct method when installing and enabling the storybook module. The error message is the following:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\media_contextual_crop\MediaContextualCropService::__construct(): Argument #6 ($fileUrlGenerator) must be of type Drupal\Core\File\FileUrlGenerator, Drupal\storybook\FileUrlGenerator given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 in Drupal\media_contextual_crop\MediaContextualCropService->__construct() (line 105 of modules/contrib/media_contextual_crop/src/MediaContextualCropService.php).

Steps to reproduce

Install and enable the storybook module with the media_contextual_crop module enabled and access to view or edit any content that is using a image crop generated by this module.

Proposed resolution

Use the FileUrlGeneratorInterface type instead of FileUrlGenerator type for the method argument that throws the error.

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇪🇸Spain ajfernandez Spain

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024