diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 693fe3a2a0af4045d5f5b8914e4e128c35b0fb94..0f056dcf176f1cfcd6e8e9604fa5cf83223749fc 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -420,7 +420,7 @@ function ajax_base_page_theme() { // 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', 'bartik') || drupal_valid_token($token, $theme)) { + if ($theme === variable_get('theme_default', 'stark') || drupal_valid_token($token, $theme)) { return $theme; } } diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 902907ade24815371c142a8da6ef05f7edbe1e09..e6c07254844ad0c5251034a0168ecdfe66c9fbcd 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -80,7 +80,7 @@ function drupal_theme_initialize() { // 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 : variable_get('theme_default', 'bartik'); + $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. @@ -1432,7 +1432,7 @@ function theme_enable($theme_list) { */ function theme_disable($theme_list) { // Don't disable the default theme. - if ($pos = array_search(variable_get('theme_default', 'bartik'), $theme_list) !== FALSE) { + if ($pos = array_search(variable_get('theme_default', 'stark'), $theme_list) !== FALSE) { unset($theme_list[$pos]); if (empty($theme_list)) { return; diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index d663d144b1831158f245a9f10f9d1de6254e426d..dce880194e1852e69e1a289c20c104ae2f1e6e1b 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -44,6 +44,12 @@ function _drupal_maintenance_theme() { // We use the default theme as the maintenance theme. If a default theme // isn't specified in the database or in settings.php, we use Bartik. + // @todo Should use the actual default theme configured, but that depends on + // configuration being available while possibly not having a working + // database connection (yet). And only if that fails, should fall back to + // 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')); } diff --git a/core/modules/block/block.admin.inc b/core/modules/block/block.admin.inc index 0e543435b123e7da24ef1017e586eaecfcc1c645..2b3c2dd3cc5007b760ef8fa2aa5e2b05a971a075 100644 --- a/core/modules/block/block.admin.inc +++ b/core/modules/block/block.admin.inc @@ -305,7 +305,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) { '#tree' => TRUE, ); - $theme_default = variable_get('theme_default', 'bartik'); + $theme_default = variable_get('theme_default', 'stark'); $admin_theme = variable_get('admin_theme'); foreach (list_themes() as $key => $theme) { // Only display enabled themes diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 55b0b40ab9337d380f30bf9d8d564fbe9ab25f68..4d942edc616e54a195de8dc9404624f895ded5e4 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -63,7 +63,7 @@ function block_help($path, $arg) { return '<p>' . t('Use this page to create a new custom block.') . '</p>'; } 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', 'bartik'); + $demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'stark'); $themes = list_themes(); $output = '<p>' . 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 <em>Save blocks</em> button at the bottom of the page. Click the <em>configure</em> link next to each block to configure its specific title and visibility settings.') . '</p>'; $output .= '<p>' . l(t('Demonstrate block regions (@theme)', array('@theme' => $themes[$demo_theme]->info['name'])), 'admin/structure/block/demo/' . $demo_theme) . '</p>'; @@ -103,7 +103,7 @@ function block_permission() { * Implements hook_menu(). */ function block_menu() { - $default_theme = variable_get('theme_default', 'bartik'); + $default_theme = variable_get('theme_default', 'stark'); $items['admin/structure/block'] = array( 'title' => 'Blocks', 'description' => 'Configure what block content appears in your site\'s sidebars and other regions.', @@ -308,7 +308,7 @@ function block_page_build(&$page) { $page['page_top']['backlink'] = array( '#type' => 'link', '#title' => t('Exit block region demonstration'), - '#href' => 'admin/structure/block' . (variable_get('theme_default', 'bartik') == $theme ? '' : '/list/' . $theme), + '#href' => 'admin/structure/block' . (variable_get('theme_default', 'stark') == $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'))), @@ -664,7 +664,7 @@ function block_theme_initialize($theme) { // 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', 'bartik'); + $default_theme = variable_get('theme_default', 'stark'); // 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)); diff --git a/core/modules/block/block.test b/core/modules/block/block.test index 6e30dd0efb89584e41ad0d058795872d5f17d00d..dbd7dc489e845b8a49ce5d55565dfeaaf7c7a186 100644 --- a/core/modules/block/block.test +++ b/core/modules/block/block.test @@ -425,7 +425,7 @@ class NewDefaultThemeBlocks extends DrupalWebTestCase { // Ensure no other theme's blocks are in the block table yet. $themes = array(); - $themes['default'] = variable_get('theme_default', 'bartik'); + $themes['default'] = variable_get('theme_default', 'stark'); if ($admin_theme = variable_get('admin_theme')) { $themes['admin'] = $admin_theme; } diff --git a/core/modules/dashboard/dashboard.module b/core/modules/dashboard/dashboard.module index 1216cc00c117f7ff2d3372d4466de6ebb9729ee9..115bc8fafa6f0559bdb5a93e4688669d36fba061 100644 --- a/core/modules/dashboard/dashboard.module +++ b/core/modules/dashboard/dashboard.module @@ -96,7 +96,7 @@ function dashboard_permission() { */ function dashboard_block_info_alter(&$blocks, $theme, $code_blocks) { $admin_theme = variable_get('admin_theme'); - if (($admin_theme && $theme == $admin_theme) || (!$admin_theme && $theme == variable_get('theme_default', 'bartik'))) { + if (($admin_theme && $theme == $admin_theme) || (!$admin_theme && $theme == variable_get('theme_default', 'stark'))) { foreach ($blocks as $module => &$module_blocks) { foreach ($module_blocks as $delta => &$block) { // Make administrative blocks that are not already in use elsewhere diff --git a/core/modules/node/node.test b/core/modules/node/node.test index 0d13c4e86362ef999e977f80710985ba2c3da9c4..a04b0e663002aca77645e12dcfb386ed0344b730 100644 --- a/core/modules/node/node.test +++ b/core/modules/node/node.test @@ -1881,7 +1881,7 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase { $custom_block['title'] = $this->randomName(); $custom_block['types[article]'] = TRUE; $custom_block['body[value]'] = $this->randomName(32); - $custom_block['regions[' . variable_get('theme_default', 'bartik') . ']'] = 'content'; + $custom_block['regions[' . variable_get('theme_default', 'stark') . ']'] = 'content'; if ($admin_theme = variable_get('admin_theme')) { $custom_block['regions[' . $admin_theme . ']'] = 'content'; } diff --git a/core/modules/statistics/statistics.test b/core/modules/statistics/statistics.test index f12490acf91dc330b4289292716d911fc535e59b..592f1653c94584aae17b0827f6709afc812c95f9 100644 --- a/core/modules/statistics/statistics.test +++ b/core/modules/statistics/statistics.test @@ -210,7 +210,7 @@ class StatisticsReportsTestCase extends StatisticsTestCase { // Configure and save the block. $block = block_load('statistics', 'popular'); - $block->theme = variable_get('theme_default', 'bartik'); + $block->theme = variable_get('theme_default', 'stark'); $block->status = 1; $block->pages = ''; $block->region = 'sidebar_first'; diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 97a4673dd69ec2cbf53bb3beb05b637b58606217..6dca80b88b723940fb66a0b15be66f71db6ef9d6 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -130,7 +130,7 @@ function system_themes_page() { $themes = system_rebuild_theme_data(); uasort($themes, 'system_sort_modules_by_info_name'); - $theme_default = variable_get('theme_default', 'bartik'); + $theme_default = variable_get('theme_default', 'stark'); $theme_groups = array(); foreach ($themes as &$theme) { @@ -315,7 +315,7 @@ function system_theme_disable() { // Check if the specified theme is one recognized by the system. if (!empty($themes[$theme])) { - if ($theme == variable_get('theme_default', 'bartik')) { + 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'); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 671147195ccbdd62ca3a770e4d697216804467e2..f33d0eaff9a4c560615f872ce3f6c8f454723b78 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -499,11 +499,11 @@ function system_install() { system_rebuild_theme_data(); // Enable the default theme. - variable_set('theme_default', 'bartik'); + variable_set('theme_default', 'stark'); db_update('system') ->fields(array('status' => 1)) ->condition('type', 'theme') - ->condition('name', 'bartik') + ->condition('name', 'stark') ->execute(); // Populate the cron key variable. @@ -1641,6 +1641,25 @@ function system_update_8001() { } } +/** + * Set Bartik as default theme if it implicitly was the default before. + * + * The default theme for Drupal core was changed from Bartik to Stark. + * Installation profiles (including Standard and Minimal) were changed to + * explicitly configure Bartik as default theme. Since Bartik was the default + * theme by default and may not have been explicitly configured as such + * previously, this update ensures that the implicit Bartik default is still the + * default. + * + * @see http://drupal.org/node/1181776 + */ +function system_update_8002() { + $theme = variable_get('theme_default'); + if (!isset($theme)) { + variable_set('theme_default', 'bartik'); + } +} + /** * @} End of "defgroup updates-7.x-to-8.x" * The next series of updates should start at 9000. diff --git a/profiles/minimal/minimal.install b/profiles/minimal/minimal.install index 059f038c2e7aa5755c85a968c96e8d0e8f50d1d3..6c56aecd2e85d9850501196954341f77fc6cc867 100644 --- a/profiles/minimal/minimal.install +++ b/profiles/minimal/minimal.install @@ -6,8 +6,14 @@ * Perform actions to set up the site for this profile. */ function minimal_install() { + // 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_enable(array($default_theme)); + theme_disable(array('stark')); + // Enable some standard blocks. - $default_theme = variable_get('theme_default', 'bartik'); $values = array( array( 'module' => 'system', diff --git a/profiles/standard/standard.install b/profiles/standard/standard.install index 5d447177fb26261c51fd7e3b3017fbd9ddc0ca46..9195ad949e1daf53eafda9adffeb855760965c39 100644 --- a/profiles/standard/standard.install +++ b/profiles/standard/standard.install @@ -62,8 +62,14 @@ function standard_install() { $full_html_format = (object) $full_html_format; filter_format_save($full_html_format); + // 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_enable(array($default_theme)); + theme_disable(array('stark')); + // Enable some standard blocks. - $default_theme = variable_get('theme_default', 'bartik'); $admin_theme = 'seven'; $values = array( array(