summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 681c520d7..db2d8712f 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -463,8 +463,8 @@ function system_admin_theme_settings() {
function system_admin_theme_submit($form, &$form_state) {
// If we're changing themes, make sure the theme has its blocks initialized.
if ($form_state['values']['admin_theme'] != variable_get('admin_theme', '0')) {
- $result = db_query("SELECT status FROM {blocks} WHERE theme = '%s'", $form_state['values']['admin_theme']);
- if (!db_num_rows($result)) {
+ $result = db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $form_state['values']['admin_theme']));
+ if (!$result) {
system_initialize_theme_blocks($form_state['values']['admin_theme']);
}
}
@@ -1266,7 +1266,7 @@ function system_default_region($theme) {
*/
function system_initialize_theme_blocks($theme) {
// Initialize theme's blocks if none already registered.
- if (!(db_num_rows(db_query("SELECT module FROM {blocks} WHERE theme = '%s'", $theme)))) {
+ if (!(db_result(db_query("SELECT COUNT(*) FROM {blocks} WHERE theme = '%s'", $theme)))) {
$default_theme = variable_get('theme_default', 'garland');
$regions = system_region_list($theme);
$result = db_query("SELECT * FROM {blocks} WHERE theme = '%s'", $default_theme);