From fa498602e4ca5824598f687268d37a442de779c7 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Tue, 6 Oct 2009 01:38:55 +0000
Subject: [PATCH] #343898 by dww and JohnAlbin: Respect hidden property in
 themes to allow for theme testing.

---
 modules/system/system.admin.inc   | 10 +++++++++-
 modules/update/update.compare.inc |  4 ++--
 themes/tests/README.txt           |  5 +++++
 3 files changed, 16 insertions(+), 3 deletions(-)
 create mode 100644 themes/tests/README.txt

diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 24f0b888d997..b7537b7a8dfa 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -199,8 +199,16 @@ function system_settings_overview() {
  * @see system_themes_form_submit()
  */
 function system_themes_form() {
-
+  // Get current list of themes.
   $themes = system_get_theme_data();
+
+  // Remove hidden themes from the display list.
+  foreach ($themes as $theme_key => $theme) {
+    if (!empty($theme->info['hidden'])) {
+      unset($themes[$theme_key]);
+    }
+  }
+
   uasort($themes, 'system_sort_modules_by_info_name');
 
   $status = array();
diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index 996855aa746b..e5f4caee7f14 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -62,7 +62,7 @@ function update_get_projects() {
  * modules or themes are being processed (there is a setting to control if
  * disabled code should be included in the Available updates report or not),
  * those are only processed after $projects has been populated with
- * information about the enabled code. 'Hidden' modules are always
+ * information about the enabled code. 'Hidden' modules and themes are always
  * ignored. This function also records the latest change time on the .info
  * files for each module or theme, which is important data which is used when
  * deciding if the cached available update data should be invalidated.
@@ -90,7 +90,7 @@ function _update_process_info_list(&$projects, $list, $project_type, $status) {
       continue;
     }
 
-    // Skip if it's a hidden module.
+    // Skip if it's a hidden module or theme.
     if (!empty($file->info['hidden'])) {
       continue;
     }
diff --git a/themes/tests/README.txt b/themes/tests/README.txt
new file mode 100644
index 000000000000..e64480fa61b1
--- /dev/null
+++ b/themes/tests/README.txt
@@ -0,0 +1,5 @@
+// $Id$
+
+The themes in this subdirectory are all used by the Drupal core testing
+framework. They are not functioning themes that could be used on a real site
+and are hidden in the administrative user interface.
-- 
GitLab