#P drush
Index: commands/core/drupal/environment_6.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/environment_6.inc,v
retrieving revision 1.8
diff -u -r1.8 environment_6.inc
--- commands/core/drupal/environment_6.inc	17 Mar 2010 13:30:16 -0000	1.8
+++ commands/core/drupal/environment_6.inc	31 Mar 2010 14:15:10 -0000
@@ -152,7 +152,20 @@
  *  Array of theme names.
  */
 function drush_theme_enable($themes) {
-  db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' AND name IN (".db_placeholders($themes, 'text').")", $themes);
+  // Scan the installation theme .info files and their engines.
+  $system_themes = system_theme_data();
+
+  // iterate through the list of system themes.
+  // if a system theme's name is one of the theme names to be enabled, then set its status to enabled
+  foreach ($system_themes as $system_theme) {
+  	foreach ($themes as $theme) {
+  		if (is_object($system_theme)) {
+  			if ($system_theme->name == $theme) {
+  				$system_theme->status = 1;
+  			}
+  		}
+  	}
+  }
 }
 
 /**
@@ -162,7 +175,20 @@
  *  Array of theme names.
  */
 function drush_theme_disable($themes) {
-  db_query("UPDATE {system} SET status = 0 WHERE type = 'theme' AND name IN (".db_placeholders($themes, 'text').")", $themes);
+  // Scan the installation theme .info files and their engines.
+  $system_themes = system_theme_data();
+
+  // iterate through the list of system themes.
+  // if a system theme's name is one of the theme names to be disabled, then set its status to disabled
+  foreach ($system_themes as $system_theme) {
+    foreach ($themes as $theme) {
+      if (is_object($system_theme)) {
+        if ($system_theme->name == $theme) {
+          $system_theme->status = 0;
+        }
+      }
+    }
+  }
 }
 
 /**
