function system_post_update_uninstall_stable

Uninstall Stable if it is no longer needed.

This needs to run after system_post_update_uninstall_classy(). This will be the case since getAvailableUpdateFunctions() returns an alphabetically sorted list of post_update hooks to be run.

See also

Drupal\Core\Update\UpdateRegistry::getAvailableUpdateFunctions()

File

core/modules/system/system.post_update.php, line 141

Code

function system_post_update_uninstall_stable() {
    
    /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
    $theme_installer = \Drupal::getContainer()->get('theme_installer');
    try {
        $theme_installer->uninstall([
            'stable',
        ]);
    } catch (\InvalidArgumentException|UnknownExtensionException $exception) {
        // Exception is thrown if Stable wasn't installed or if there are themes
        // depending on it.
    }
}

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