SpamMasterLicService::__construct(): Argument #7

Created on 12 April 2024, 8 months ago
Updated 14 April 2024, 8 months ago

Problem/Motivation

Upgrading to version 2.43 gives this white screen of death:

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\spammaster\SpamMasterLicService::__construct(): Argument #7 ($language_manager) must be of type Drupal\Core\Language\LanguageManagerInterface, Drupal\spammaster\SpamMasterMailService given, called in /var/www/[...]/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\spammaster\SpamMasterLicService->__construct() (line 103 of modules/contrib/spammaster/src/SpamMasterLicService.php).
🐛 Bug report
Status

Closed: works as designed

Version

2.43

Component

Code

Created by

🇳🇱Netherlands Marceldeb

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

Comments & Activities

  • Issue created by @Marceldeb
  • Assigned to pedro-alves
  • Status changed to Needs review 8 months ago
  • 🇵🇹Portugal pedro-alves

    Hi Marceldeb,

    Thanks for reporting, which version are you upgrading from?

    We are using the correct interface for the dependency injection:

    use Drupal\Core\Language\LanguageManagerInterface;
      /**
       * The language manager service.
       *
       * @var \Drupal\Core\Language\LanguageManagerInterface
       */
      protected $languageManager;
    

    Also used in __construct(): Argument #7
    LanguageManagerInterface $language_manager,

    Are you able to flush your cache in order for these lic service pick up the dependency injections?
    Please advise.

  • 🇳🇱Netherlands Marceldeb

    Hi Pedro,

    I am upgrading from 2.30. When going to a newer version, this error will occur. I can't flush caches using the interface, because the entire website is blocked because of the white error screen.

    I will try to flush using command line and report back. Thanks for your reply so far.

  • 🇳🇱Netherlands Marceldeb

    Hi Pedro,

    I just cleared cache and all works again. Thanks!

    Marcel

  • 🇵🇹Portugal pedro-alves

    You may also clean the cache by truncating / deleting all database tables named cache*, cache_* with phpmyadmin.
    Afterwards refresh your website page and drupal will rebuild those tables.

  • Status changed to Closed: works as designed 8 months ago
  • 🇵🇹Portugal pedro-alves

    Great news.
    Will close this one now.
    Thanks for reporting.

Production build 0.71.5 2024