From 06137c696987dfbe551700beb61206ce706fafd1 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Fri, 27 May 2011 19:55:25 -0400
Subject: [PATCH] Issue #1013268 by Ralf, droplet: Ensure that admin theme is compatible with core.

---
 modules/system/system.admin.inc |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 9e7d69dd3aed5d6a6a6abecef02fa05c3b1157a2..20d9ac3267fed68b2ace1c65e962367c68f174a5 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -132,12 +132,12 @@ function system_themes_page() {
 
   $theme_default = variable_get('theme_default', 'bartik');
   $theme_groups  = array();
+  $admin_theme_options = array();
 
   foreach ($themes as &$theme) {
     if (!empty($theme->info['hidden'])) {
       continue;
     }
-    $admin_theme_options[$theme->name] = $theme->info['name'];
     $theme->is_default = ($theme->name == $theme_default);
 
     // Identify theme screenshot.
@@ -163,12 +163,17 @@ function system_themes_page() {
       }
     }
 
-    if (empty($theme->status)) {
-     // Ensure this theme is compatible with this version of core.
-     // Require the 'content' region to make sure the main page
-     // content has a common place in all themes.
-      $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content']));
-      $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0;
+    // Ensure this theme is compatible with this version of core.
+    // Require the 'content' region to make sure the main page
+    // content has a common place in all themes.
+    $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content']));
+    $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0;
+
+    if (!$theme->incompatible_core && !$theme->incompatible_php) {
+      $admin_theme_options[$theme->name] = $theme->info['name'];
+    }
+    else {
+      $theme->status = '0';
     }
     $query['token'] = drupal_get_token('system-theme-operation-link');
     $theme->operations = array();
-- 
1.7.4.1

