// is possible, because loadActiveTheme() always loads the Twig theme
// engine. This is desired, because missing or malformed theme configuration
// should not leave the application in a broken state. By falling back to
// default output, the user is able to reconfigure the theme through the UI.
// Lastly, tests are expected to operate with no theme by default, so as to
// only assert the original theme output of modules (unless a test manually
// installs a specific theme).
if (empty($themes) || !
$theme_name || !
isset($themes[$theme_name])) { $theme_name = 'core';
// /core/core.info.yml does not actually exist, but is required because
// Extension expects a pathname.
$active_theme =
$this->
getActiveTheme(new Extension($this->root, 'theme', 'core/core.info.yml'
));
// Early-return and do not set state, because the initialized $theme_name
// differs from the original $theme_name.
return $active_theme;
} // Find all our ancestor themes and put them in an array.
$base_themes =
[];
$ancestor =
$theme_name;
while ($ancestor &&
isset($themes[$ancestor]->base_theme
)) { $ancestor =
$themes[$ancestor]->base_theme;