Commit 9a8cfc2f authored by Dries's avatar Dries
Browse files

- Patch #541346 by Jaza: enabling admin theme doesn't initialize blocks.

parent 8106cda1
...@@ -514,7 +514,7 @@ function block_system_themes_form_submit(&$form, &$form_state) { ...@@ -514,7 +514,7 @@ function block_system_themes_form_submit(&$form, &$form_state) {
} }
} }
} }
if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] != variable_get('admin_theme', 0)) { if ($form_state['values']['admin_theme'] && $form_state['values']['admin_theme'] !== variable_get('admin_theme', 0)) {
// If we're changing themes, make sure the theme has its blocks initialized. // If we're changing themes, make sure the theme has its blocks initialized.
$has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', array(':theme' => $form_state['values']['admin_theme']), 0, 1)->fetchField(); $has_blocks = (bool) db_query_range('SELECT 1 FROM {block} WHERE theme = :theme', array(':theme' => $form_state['values']['admin_theme']), 0, 1)->fetchField();
if (!$has_blocks) { if (!$has_blocks) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment