Theme deletion causes ThemeHandler::addTheme() error

Created on 24 December 2024, about 17 hours ago

Problem/Motivation

1. Following the Upgrade Status entries in the report section of D10, I deleted the msha theme among other modules. The upgrade to 11.1.0 was unsuccessful and lead to the message:
TypeError: Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74 in Drupal\Core\Extension\ThemeHandler->addTheme() (line 84 of /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php).

similar to the one described
https://www.drupal.org/project/drupal/issues/3478628#mr10272-note412963

2. Drush was also rendered inoperable also with the below message.

[warning] Undefined array key "insha" ThemeHandler.php:74
TypeError: Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74 in /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 84 #0 /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php(74): Drupal\Core\Extension\ThemeHandler->addTheme()
. . . Full error message below. . .
TypeError: Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74 in Drupal\Core\Extension\ThemeHandler->addTheme() (line 84 of /var/www/html/drupal/core/lib/Drupal/Core/Extension/ThemeHandler.php).
[warning] Drush command terminated abnormally.

3. I checked and found that the imsha theme was missing in the themes directory and used composer to reinstall it.

4. Invoked the drush updb command but it gave the following message:
[error] (Currently using Missing or invalid modules The following modules are marked as installed in the core.extension
configuration, but they are missing:
* mailsystem
* symfony_mailer_lite

5. After reinstalling both modules with composer, the drush updb ran and both drush and the drupal site were successfully recovered.

Steps to reproduce

I removed an incompatible theme (msha) and modules during a failed upgrade attempt from 10.4.0 to 11.1.0.

Proposed resolution

Unknown. This report is submitted as a diagnostic aid.

Remaining tasks

Unknown.

User interface changes

None.

API changes

None

Data model changes

None.

πŸ› Bug report
Status

Active

Version

6.0

Component

Base system (internal API)

Created by

πŸ‡ΊπŸ‡ΈUnited States othdvlpr

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

Comments & Activities

Production build 0.71.5 2024