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.
Issue fork media_contextual_crop-3470148
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ajfernandez commentedComment #4
ajfernandez commentedComment #6
ajfernandez commentedComment #7
drdam commentedFixed in release 2.1.3
Comment #8
drdam commentedComment #9
ajfernandez commentedThanks @drdam!
Comment #10
drdam commented