1.20.x system.install system_update_1077()

Explicitly set the admin theme to an actual theme, instead of the special 'Default theme' option.

Related topics

File

modules/system/system.install, line 3216
Install, update and uninstall functions for the system module.

Code

function system_update_1077() {
  $config = config('system.core');
  $admin_theme = $config->get('admin_theme');
  $default_theme = $config->get('theme_default');

  // Check whether the admin theme is currently set to the special 'Default
  // theme' option, or if empty.
  if ($admin_theme == '0' || $admin_theme == '') {
    // Explicitly set the admin theme to whichever actual theme is selected as
    // the default.
    $config->set('admin_theme', $default_theme);
    $config->save();
  }
}