reverted: --- b/core/includes/ajax.inc +++ a/core/includes/ajax.inc @@ -411,7 +411,7 @@ // to see the default theme, token validation isn't required for that, and // bypassing it allows most use-cases to work even when accessed from the // page cache. + if ($theme === variable_get('theme_default', 'stark') || drupal_valid_token($token, $theme)) { - if ($theme === config('system.theme')->get('default') || drupal_valid_token($token, $theme)) { return $theme; } } diff -u b/core/includes/theme.inc b/core/includes/theme.inc --- b/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -63,7 +63,7 @@ * @see drupal_theme_access() */ function _drupal_theme_access($theme) { - $admin_theme = config('system.theme')->get('admin'); + $admin_theme = variable_get('admin_theme'); return !empty($theme->status) || ($admin_theme && $theme->name == $admin_theme); } @@ -83,7 +83,7 @@ // Only select the user selected theme if it is available in the // list of themes that can be accessed. - $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : config('system.theme')->get('default'); + $theme = !empty($user->theme) && drupal_theme_access($user->theme) ? $user->theme : variable_get('theme_default', 'stark'); // Allow modules to override the theme. Validation has already been performed // inside menu_get_custom_theme(), so we do not need to check it again here. @@ -1288,7 +1288,6 @@ * @return * The value of the requested setting, NULL if the setting does not exist. */ - function theme_get_setting($setting_name, $theme = NULL) { $cache = &drupal_static(__FUNCTION__, array()); @@ -1350,7 +1349,7 @@ $cache[$theme]->setData(NestedArray::mergeDeep($cache[$theme]->get(), config('system.theme.global')->get())); if ($theme) { - // Get the saved theme-specific settings configuration. + // Get the saved theme-specific settings from the configuration system. $cache[$theme]->setData(NestedArray::mergeDeep($cache[$theme]->get(), config($theme . '.settings')->get())); // If the theme does not support a particular feature, override the global @@ -1495,7 +1494,7 @@ */ function theme_disable($theme_list) { // Don't disable the default theme. - if ($pos = array_search(config('system.theme')->get('default'), $theme_list) !== FALSE) { + if ($pos = array_search(variable_get('theme_default', 'stark'), $theme_list) !== FALSE) { unset($theme_list[$pos]); if (empty($theme_list)) { return; reverted: --- b/core/includes/theme.maintenance.inc +++ a/core/includes/theme.maintenance.inc @@ -50,11 +50,7 @@ // Stark otherwise. Since there is no low-level access to configuration // currently, we only consult settings.php and fall back to Bartik // otherwise, as it looks generic enough and way more user-friendly. + $custom_theme = variable_get('maintenance_theme', variable_get('theme_default', 'bartik')); - $config = config('system.theme'); - $custom_theme = $config->get('maintenance'); - if (empty($custom_theme)) { - $custom_theme = $config->get('default'); - } } // Ensure that system.module is loaded. reverted: --- b/core/modules/block/block.admin.inc +++ a/core/modules/block/block.admin.inc @@ -307,9 +307,8 @@ '#tree' => TRUE, ); + $theme_default = variable_get('theme_default', 'stark'); + $admin_theme = variable_get('admin_theme'); - $config = config('system.theme'); - $theme_default = $config->get('default'); - $admin_theme = $config->get('admin'); foreach (list_themes() as $key => $theme) { // Only display enabled themes if ($theme->status) { reverted: --- b/core/modules/block/block.module +++ a/core/modules/block/block.module @@ -63,7 +63,7 @@ return '

' . t('Use this page to create a new custom block.') . '

'; } if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) { + $demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'stark'); - $demo_theme = !empty($arg[4]) ? $arg[4] : config('system.theme')->get('default'); $themes = list_themes(); $output = '

' . t('This page provides a drag-and-drop interface for assigning a block to a region, and for controlling the order of blocks within regions. Since not all themes implement the same regions, or display regions in the same way, blocks are positioned on a per-theme basis. Remember that your changes will not be saved until you click the Save blocks button at the bottom of the page. Click the configure link next to each block to configure its specific title and visibility settings.') . '

'; $output .= '

' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '

'; @@ -103,7 +103,7 @@ * Implements hook_menu(). */ function block_menu() { + $default_theme = variable_get('theme_default', 'stark'); - $default_theme = config('system.theme')->get('default'); $items['admin/structure/block'] = array( 'title' => 'Blocks', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', @@ -306,7 +306,7 @@ $page['page_top']['backlink'] = array( '#type' => 'link', '#title' => t('Exit block region demonstration'), + '#href' => 'admin/structure/block' . (variable_get('theme_default', 'stark') == $theme ? '' : '/list/' . $theme), - '#href' => 'admin/structure/block' . (config('system.theme')->get('default') == $theme ? '' : '/list/' . $theme), // Add the "overlay-restore" class to indicate this link should restore // the context in which the region demonstration page was opened. '#options' => array('attributes' => array('class' => array('block-demo-backlink', 'overlay-restore'))), @@ -674,7 +674,7 @@ // Initialize theme's blocks if none already registered. $has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', 0, 1, array(':theme' => $theme))->fetchField(); if (!$has_blocks) { + $default_theme = variable_get('theme_default', 'stark'); - $default_theme = config('system.theme')->get('default'); // Apply only to new theme's visible regions. $regions = system_region_list($theme, REGIONS_VISIBLE); $result = db_query("SELECT * FROM {block} WHERE theme = :theme", array(':theme' => $default_theme), array('fetch' => PDO::FETCH_ASSOC)); reverted: --- b/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php +++ a/core/modules/block/lib/Drupal/block/Tests/BlockHiddenRegionTest.php @@ -29,7 +29,7 @@ ->key(array( 'module' => 'search', 'delta' => 'form', + 'theme' => variable_get('theme_default', 'stark'), - 'theme' => config('system.theme')->get('default'), )) ->fields(array( 'status' => 1, @@ -56,7 +56,7 @@ // Enable "block_test_theme" and set it as the default theme. $theme = 'block_test_theme'; theme_enable(array($theme)); + variable_set('theme_default', $theme); - config('system.theme')->set('default', $theme)->save(); menu_router_rebuild(); // Ensure that "block_test_theme" is set as the default theme. reverted: --- b/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php +++ a/core/modules/block/lib/Drupal/block/Tests/BlockInvalidRegionTest.php @@ -32,13 +32,12 @@ * Tests that blocks assigned to invalid regions work correctly. */ function testBlockInInvalidRegion() { - $config = config('system.theme'); // Enable a test block in the default theme and place it in an invalid region. db_merge('block') ->key(array( 'module' => 'block_test', 'delta' => 'test_html_id', + 'theme' => variable_get('theme_default', 'stark'), - 'theme' => $config->get('default'), )) ->fields(array( 'status' => 1, @@ -62,7 +61,7 @@ ->key(array( 'module' => 'block_test', 'delta' => 'test_html_id', + 'theme' => variable_get('theme_default', 'stark'), - 'theme' => $config->get('default'), )) ->fields(array( 'region' => 'invalid_region', reverted: --- b/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php +++ a/core/modules/block/lib/Drupal/block/Tests/NewDefaultThemeBlocksTest.php @@ -35,9 +35,8 @@ // Ensure no other theme's blocks are in the block table yet. $themes = array(); + $themes['default'] = variable_get('theme_default', 'stark'); + if ($admin_theme = variable_get('admin_theme')) { - $config = config('system.theme'); - $themes['default'] = $config->get('default'); - if ($admin_theme = $config->get('admin')) { $themes['admin'] = $admin_theme; } $count = db_query_range('SELECT 1 FROM {block} WHERE theme NOT IN (:themes)', 0, 1, array(':themes' => $themes))->fetchField(); @@ -56,7 +55,7 @@ // the default theme had. $new_theme = 'bartik'; theme_enable(array($new_theme)); + variable_set('theme_default', $new_theme); - config('system.theme')->set('default', $new_theme)->save(); $result = db_query('SELECT * FROM {block} WHERE theme = :theme', array(':theme' => $new_theme)); foreach ($result as $block) { unset($block->theme, $block->bid); reverted: --- b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php +++ a/core/modules/color/lib/Drupal/color/Tests/ColorTest.php @@ -68,7 +68,7 @@ * Tests the Color module functionality using the given theme. */ function _testColor($theme, $test_values) { + variable_set('theme_default', $theme); - config('system.theme')->set('default', $theme)->save(); $settings_path = 'admin/appearance/settings/' . $theme; $this->drupalLogin($this->big_user); @@ -114,7 +114,7 @@ * Tests whether the provided color is valid. */ function testValidColor() { + variable_set('theme_default', 'bartik'); - config('system.theme')->set('default', 'bartik')->save(); $settings_path = 'admin/appearance/settings/bartik'; $this->drupalLogin($this->big_user); reverted: --- b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php +++ a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php @@ -430,7 +430,7 @@ function testCommentLinks() { // Bartik theme alters comment links, so use a different theme. theme_enable(array('stark')); + variable_set('theme_default', 'stark'); - config('system.theme')->set('default', 'stark')->save(); // Remove additional user permissions from $this->web_user added by setUp(), // since this test is limited to anonymous and authenticated roles only. reverted: --- b/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php +++ a/core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php @@ -115,14 +115,13 @@ $this->assertText($node4->label(), t('Node found in block.')); // Create the custom block. - $theme_config = config('system.theme'); $custom_block = array(); $custom_block['info'] = $this->randomName(); $custom_block['title'] = $this->randomName(); $custom_block['types[article]'] = TRUE; $custom_block['body[value]'] = $this->randomName(32); + $custom_block['regions[' . variable_get('theme_default', 'stark') . ']'] = 'content'; + if ($admin_theme = variable_get('admin_theme')) { - $custom_block['regions[' . $theme_config->get('default') . ']'] = 'content'; - if ($admin_theme = $theme_config->get('admin')) { $custom_block['regions[' . $admin_theme . ']'] = 'content'; } $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block')); reverted: --- b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php +++ a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDTestBase.php @@ -27,7 +27,7 @@ ->key(array( 'module' => 'user', 'delta' => 'login', + 'theme' => variable_get('theme_default', 'stark'), - 'theme' => config('system.theme')->get('default'), )) ->fields(array( 'status' => 1, reverted: --- b/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php +++ a/core/modules/shortcut/lib/Drupal/shortcut/Tests/ShortcutLinksTest.php @@ -62,7 +62,7 @@ */ function testShortcutQuickLink() { theme_enable(array('seven')); + variable_set('admin_theme', 'seven'); - config('system.theme')->set('admin', 'seven')->save(); variable_set('node_admin_theme', TRUE); $this->drupalGet($this->set->links[0]['link_path']); $this->assertRaw(t('Remove from %title shortcuts', array('%title' => $this->set->title)), '"Add to shortcuts" link properly switched to "Remove from shortcuts".'); @@ -120,7 +120,7 @@ */ function testNoShortcutLink() { // Change to a theme that displays shortcuts. + variable_set('theme_default', 'seven'); - config('system.theme')->set('default', 'seven')->save(); $this->drupalGet('page-that-does-not-exist'); $this->assertNoRaw('add-shortcut', t('Add to shortcuts link was not shown on a page not found.')); reverted: --- b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php +++ a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php @@ -83,7 +83,7 @@ // Configure and save the block. $block = block_load('statistics', 'popular'); + $block->theme = variable_get('theme_default', 'stark'); - $block->theme = config('system.theme')->get('default'); $block->status = 1; $block->pages = ''; $block->region = 'sidebar_first'; reverted: --- b/core/modules/system/config/system.theme.yml +++ /dev/null @@ -1,3 +0,0 @@ -admin: '0' -default: stark -maintenance: '' reverted: --- b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php +++ a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php @@ -154,7 +154,7 @@ // The test theme overrides system.base.css without an implementation, // thereby removing it. theme_enable(array('test_theme')); + variable_set('theme_default', 'test_theme'); - config('system.theme')->set('default', 'test_theme')->save(); // This gets the form, and emulates an Ajax submission on it, including // adding markup to the HEAD and BODY for any lazy loaded JS/CSS files. reverted: --- b/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php +++ a/core/modules/system/lib/Drupal/system/Tests/Batch/PageTest.php @@ -31,10 +31,8 @@ function testBatchProgressPageTheme() { // Make sure that the page which starts the batch (an administrative page) // is using a different theme than would normally be used by the batch API. + variable_set('theme_default', 'bartik'); + variable_set('admin_theme', 'seven'); - config('system.theme') - ->set('default', 'bartik') - ->set('admin', 'seven') - ->save(); // Log in as an administrator who can see the administrative theme. $admin_user = $this->drupalCreateUser(array('view the administration theme')); $this->drupalLogin($admin_user); reverted: --- b/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php +++ a/core/modules/system/lib/Drupal/system/Tests/Menu/RouterTest.php @@ -29,10 +29,8 @@ // Make the tests below more robust by explicitly setting the default theme // and administrative theme that they expect. theme_enable(array('bartik')); + variable_set('theme_default', 'bartik'); + variable_set('admin_theme', 'seven'); - config('system.theme') - ->set('default', 'bartik') - ->set('admin', 'seven') - ->save(); theme_disable(array('stark')); // Enable navigation menu block. reverted: --- b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -165,8 +165,7 @@ */ function testAdministrationTheme() { theme_enable(array('stark')); + variable_set('theme_default', 'stark'); - $config = config('system.theme'); - $config->set('default', 'stark')->save(); // Enable an administration theme and show it on the node admin pages. $edit = array( 'admin_theme' => 'seven', @@ -199,7 +198,7 @@ $this->assertRaw('core/themes/stark', t('Site default theme used on the add content page.')); // Reset to the default theme settings. + variable_set('theme_default', 'bartik'); - $config->set('default', 'bartik')->save(); $edit = array( 'admin_theme' => '0', 'node_admin_theme' => FALSE, @@ -221,7 +220,7 @@ theme_enable(array('bartik')); $this->drupalGet('admin/appearance'); $this->clickLink(t('Set default')); + $this->assertEqual(variable_get('theme_default', ''), 'bartik'); - $this->assertEqual(config('system.theme')->get('default'), 'bartik'); // Test the default theme on the secondary links (blocks admin page). $this->drupalGet('admin/structure/block'); reverted: --- b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php +++ a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php @@ -124,7 +124,7 @@ * Ensures a themes template is overrideable based on the 'template' filename. */ function testTemplateOverride() { + variable_set('theme_default', 'test_theme'); - config('system.theme')->set('default', 'test_theme')->save(); $this->drupalGet('theme-test/template-test'); $this->assertText('Success: Template overridden.', t('Template overridden by defined \'template\' filename.')); } diff -u b/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc --- b/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -118,7 +118,7 @@ $themes = system_rebuild_theme_data(); uasort($themes, 'system_sort_modules_by_info_name'); - $theme_default = config('system.theme')->get('default'); + $theme_default = variable_get('theme_default', 'stark'); $theme_groups = array(); foreach ($themes as &$theme) { @@ -241,13 +241,12 @@ '#type' => 'fieldset', '#title' => t('Administration theme'), ); - $admin_theme = config('system.theme')->get('admin'); $form['admin_theme']['admin_theme'] = array( '#type' => 'select', '#options' => array(0 => t('Default theme')) + $theme_options, '#title' => t('Administration theme'), '#description' => t('Choose "Default theme" to always use the same theme as the rest of the site.'), - '#default_value' => empty($admin_theme) ? 0 : $admin_theme, + '#default_value' => variable_get('admin_theme', 0), ); $form['admin_theme']['actions'] = array('#type' => 'actions'); $form['admin_theme']['actions']['submit'] = array( @@ -262,7 +261,7 @@ */ function system_themes_admin_form_submit($form, &$form_state) { drupal_set_message(t('The configuration options have been saved.')); - config('system.theme')->set('admin', $form_state['values']['admin_theme'])->save(); + variable_set('admin_theme', $form_state['values']['admin_theme']); } /** @@ -298,7 +297,7 @@ // Check if the specified theme is one recognized by the system. if (!empty($themes[$theme])) { - if ($theme == config('system.theme')->get('default')) { + if ($theme == variable_get('theme_default', 'stark')) { // Don't disable the default theme. drupal_set_message(t('%theme is the default theme and cannot be disabled.', array('%theme' => $themes[$theme]->info['name'])), 'error'); } @@ -331,8 +330,7 @@ theme_enable(array($theme)); } // Set the default theme. - $config = config('system.theme'); - $config->set('default', $theme)->save(); + variable_set('theme_default', $theme); // Rebuild the menu. This duplicates the menu_router_rebuild() in // theme_enable(). However, modules must know the current default theme in @@ -344,7 +342,7 @@ // The status message depends on whether an admin theme is currently in use: // a value of 0 means the admin theme is set to be the default theme. - $admin_theme = $config->get('admin'); + $admin_theme = variable_get('admin_theme', 0); if ($admin_theme != 0 && $admin_theme != $theme) { drupal_set_message(t('Please note that the administration theme is still set to the %admin_theme theme; consequently, the theme on this page remains unchanged. All non-administrative sections of the site, however, will show the selected %selected_theme theme by default.', array( '%admin_theme' => $themes[$admin_theme]->info['name'], diff -u b/core/modules/system/system.install b/core/modules/system/system.install --- b/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -507,7 +507,7 @@ */ function system_install() { // Enable the default theme. - config('system.theme')->set('default', 'stark')->save(); + variable_set('theme_default', 'stark'); db_update('system') ->fields(array('status' => 1)) ->condition('type', 'theme') @@ -2019,12 +2019,6 @@ } $new_config->save(); } - - update_variables_to_config('system.theme', array( - 'admin_theme' => 'admin', - 'theme_default' => 'default', - 'maintenance_theme' => 'maintenance', - )); } /** reverted: --- b/core/modules/system/system.module +++ a/core/modules/system/system.module @@ -237,7 +237,7 @@ ), 'view the administration theme' => array( 'title' => t('View the administration theme'), + 'description' => variable_get('admin_theme') ? '' : t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))), - 'description' => config('system.theme')->get('admin') ? '' : t('This is only used when the site is configured to use a separate administration theme on the Appearance page.', array('@appearance-url' => url('admin/appearance'))), ), 'access site reports' => array( 'title' => t('View site reports'), @@ -2202,7 +2202,7 @@ if ($request = request()) { $path = $request->attributes->get('system_path'); if (user_access('view the administration theme') && path_is_admin($path)) { + return variable_get('admin_theme'); - return config('system.theme')->get('admin'); } } } reverted: --- b/core/modules/system/tests/modules/menu_test/menu_test.module +++ a/core/modules/system/tests/modules/menu_test/menu_test.module @@ -462,7 +462,7 @@ function menu_test_theme_callback($argument) { // Test using the variable administrative theme. if ($argument == 'use-admin-theme') { + return variable_get('admin_theme'); - return config('system.theme')->get('admin'); } // Test using a theme that exists, but may or may not be enabled. elseif ($argument == 'use-stark-theme') { reverted: --- b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php +++ a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/ThemeTest.php @@ -25,10 +25,8 @@ // Make sure we are using distinct default and administrative themes for // the duration of these tests. + variable_set('theme_default', 'bartik'); + variable_set('admin_theme', 'seven'); - config('system.theme') - ->set('default', 'bartik') - ->set('admin', 'seven') - ->save(); // Create and log in as a user who has permission to add and edit taxonomy // terms and view the administrative theme. reverted: --- b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php +++ a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php @@ -29,7 +29,7 @@ ->key(array( 'module' => 'user', 'delta' => 'login', + 'theme' => variable_get('theme_default', 'stark'), - 'theme' => config('system.theme')->get('default'), )) ->fields(array( 'status' => 1, reverted: --- b/profiles/minimal/minimal.install +++ a/profiles/minimal/minimal.install @@ -15,7 +15,7 @@ // Enable Bartik theme and set it as default theme instead of Stark. // @see system_install() $default_theme = 'bartik'; + variable_set('theme_default', $default_theme); - config('system.theme')->set('default', $default_theme); theme_enable(array($default_theme)); theme_disable(array('stark')); reverted: --- b/profiles/standard/standard.install +++ a/profiles/standard/standard.install @@ -71,8 +71,7 @@ // Enable Bartik theme and set it as default theme instead of Stark. // @see system_install() $default_theme = 'bartik'; + variable_set('theme_default', $default_theme); - $theme_config = config('system.theme'); - $theme_config->set('default', $default_theme)->save(); theme_enable(array($default_theme)); theme_disable(array('stark')); @@ -410,6 +409,6 @@ ->condition('type', 'theme') ->condition('name', 'seven') ->execute(); + variable_set('admin_theme', 'seven'); - $theme_config->set('admin', 'seven')->save(); variable_set('node_admin_theme', '1'); }