Error: Attempt to modify property "sub_themes" on null if ancestor theme is missing

Created on 30 August 2023, 10 months ago

Problem/Motivation

If theme 'current' has base_theme 'parent', and 'parent' has base_theme 'ancestor', and ancestor doesn't exist, then the extension system crashes with:

[error] Error: Attempt to modify property "sub_themes" on null in Drupal\Core\Extension\ThemeExtensionList->fillInSubThemeData() (line 189 of core/lib/Drupal/Core/Extension/ThemeExtensionList.php) #0 /core/lib/Drupal/Core/Extension/ThemeExtensionList.php(143): Drupal\Core\Extension\ThemeExtensionList->fillInSubThemeData(Array, Array)
#1 core/lib/Drupal/Core/Extension/ExtensionList.php(282): Drupal\Core\Extension\ThemeExtensionList->doList()

doGetBaseThemes() appears to be checking for this:

    // Does the base theme exist?
    if (!isset($themes[$base_key])) {
      return [$base_key => NULL];
    }

but I wonder if the problem arises when the themes are processed in a particular order, as in the case of my themes, alphabetical order of their names meant they would be processed in the order:

- current
- parent
- ancestor

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
ExtensionΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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

Comments & Activities

Production build 0.69.0 2024