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.

Command icon 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

ajfernandez created an issue. See original summary.

ajfernandez’s picture

Issue summary: View changes
ajfernandez’s picture

Status: Active » Needs review

  • drdam committed 997529ce on 2.1.x authored by ajfernandez
    Resolve #3470148 "Type error when installing the storybook module"
    
ajfernandez’s picture

drdam’s picture

Status: Needs review » Fixed

Fixed in release 2.1.3

drdam’s picture

Status: Fixed » Closed (fixed)
ajfernandez’s picture

Thanks @drdam!

drdam’s picture