Problem/Motivation

I ran into the following issue in attempting to run drush cr -y:

Fatal error: Uncaught TypeError: Argument 1 passed to Drupal\search_api_attachments\ExtractFileValidator::__construct() must be an instance of Drupal\Core\File\MimeType\MimeTypeGuesser, instance of Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 257 and defined in /var/www/html/web/modules/contrib/search_api_attachments/src/ExtractFileValidator.php:30
Stack trace:
#0 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(257): Drupal\search_api_attachments\ExtractFileValidator->__construct(Object(Drupal\Core\ProxyClass\File\MimeType\MimeTypeGuesser))
#1 /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php(171): Drupal\Component\DependencyInjection\Container->createService(Array, 'search_api_atta...')
#2 /var/www/html/web/modules/contrib/devel/webprofiler/src/DependencyInjection/TraceableContainer.php(50): Drupal\Component\DependencyInjection\Container->get('search_api_ in /var/www/html/web/modules/contrib/search_api_attachments/src/ExtractFileValidator.php on line 30
[warning] Drush command terminated abnormally.

Steps to reproduce

I'm using "drupal/core": "9.1.8 and the "drupal/search_api_attachments": "9.0.x-dev#642a6b34"

Proposed resolution

Replace the reference to the class "Drupal\Core\File\MimeType\MimeTypeGuesser"
by using the interface "Symfony\Component\Mime\MimeTypeGuesserInterface"

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

sarci created an issue. See original summary.

izus’s picture

thanks for this

  • izus committed a2c2268 on 9.0.x authored by sarci
    Issue #3213815 by sarci: Fatal error: ExtractFileValidator::__construct...
izus’s picture

this is now merged :)

izus’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.