function system_update_8014

Install the Stable base theme if needed.

File

core/modules/system/system.install, line 2171

Code

function system_update_8014() {
    $theme_handler = \Drupal::service('theme_handler');
    if ($theme_handler->themeExists('stable')) {
        return;
    }
    $theme_handler->refreshInfo();
    $theme_installer = \Drupal::service('theme_installer');
    foreach ($theme_handler->listInfo() as $theme) {
        // We first check that a base theme is set because if it's set to false then
        // it's unset in
        // \Drupal\Core\Extension\ThemeExtensionList::createExtensionInfo().
        if (isset($theme->info['base theme']) && $theme->info['base theme'] == 'stable') {
            $theme_installer->install([
                'stable',
            ]);
            return;
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.