? fix-for-enabling-new-projects.diff
? includes/table.inc
Index: commands/core/drupal/environment_5.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/environment_5.inc,v
retrieving revision 1.5
diff -u -r1.5 environment_5.inc
--- commands/core/drupal/environment_5.inc	27 Jan 2010 16:29:19 -0000	1.5
+++ commands/core/drupal/environment_5.inc	21 Feb 2010 20:06:14 -0000
@@ -11,14 +11,19 @@
 /**
  * Get complete information for all available modules.
  *
+ * We need to set the type for those modules that are not already in the system table.
+ * Also In Drupal 5, system_modules() returns NULL for the dependency list of the module if there are no dependencies.
+ * We will override this to be an empty array instead to be compatible to Drupal 6 and 7.
+ *
  * @return
  *   An array containing module info for all available modules.
  */
 function drush_get_modules() {
   $modules = module_rebuild_cache();
-  // In Drupal 5, system_modules() returns NULL for the dependency list of the module if there are no dependencies.
-  // We will override this to be an empty array instead to be compatible to Drupal 6 and 7
   foreach ($modules as $module) {
+    if (!isset($module->type)) {
+      $module->type = 'module';
+    }
     if (empty($module->info['dependencies'])) {
       $module->info['dependencies'] = array();
     }
@@ -26,6 +31,7 @@
       $module->info['dependents'] = array();
     }
   }
+
   return $modules;
 }
 
@@ -140,11 +146,20 @@
 /**
  * Get complete information for all available themes.
  *
+ * We need to set the type for those themes that are not already in the system table.
+ *
  * @return
  *   An array containing theme info for all available themes.
  */
 function drush_get_themes() {
-  return system_theme_data();
+  $themes = system_theme_data();
+  foreach ($themes as $theme) {
+    if (!isset($theme->type)) {
+      $theme->type = 'theme';
+    }
+  }
+
+  return $themes;
 }
 
 /**
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.5
diff -u -r1.5 environment_6.inc
--- commands/core/drupal/environment_6.inc	27 Jan 2010 16:29:19 -0000	1.5
+++ commands/core/drupal/environment_6.inc	21 Feb 2010 20:06:14 -0000
@@ -11,13 +11,23 @@
 /**
  * Get complete information for all available modules.
  *
+ * We need to set the type for those modules that are not already in the system table.
+ *
  * @return
- *   An array containing module info for all installed modules.
+ *   An array containing module info for all available modules.
  */
 function drush_get_modules() {
-  return module_rebuild_cache();
+  $modules = module_rebuild_cache();
+  foreach ($modules as $module) {
+    if (!isset($module->type)) {
+      $module->type = 'module';
+    }
+  }
+
+  return $modules;
 }
 
+
 /**
  * Return dependencies and its status for modules.
  *
@@ -115,11 +125,20 @@
 /**
  * Get complete information for all available themes.
  *
+ * We need to set the type for those themes that are not already in the system table.
+ *
  * @return
  *   An array containing theme info for all available themes.
  */
 function drush_get_themes() {
-  return list_themes(TRUE);
+  $themes = system_theme_data();
+  foreach ($themes as $theme) {
+    if (!isset($theme->type)) {
+      $theme->type = 'theme';
+    }
+  }
+
+  return $themes;
 }
 
 /**
Index: commands/core/drupal/environment_7.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/environment_7.inc,v
retrieving revision 1.8
diff -u -r1.8 environment_7.inc
--- commands/core/drupal/environment_7.inc	27 Jan 2010 16:29:19 -0000	1.8
+++ commands/core/drupal/environment_7.inc	21 Feb 2010 20:06:14 -0000
@@ -128,7 +128,7 @@
  *   An array containing theme info for all available themes.
  */
 function drush_get_themes() {
-  return list_themes(TRUE);
+  return system_rebuild_theme_data();
 }
 
 /**
