﻿Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.197
diff -u -r1.197 system.admin.inc
--- modules/system/system.admin.inc	26 Aug 2009 10:53:45 -0000	1.197
+++ modules/system/system.admin.inc	5 Sep 2009 10:21:25 -0000
@@ -1,4 +1,4 @@
-<?php
+﻿<?php
 // $Id: system.admin.inc,v 1.197 2009/08/26 10:53:45 dries Exp $
 
 /**
@@ -985,7 +985,10 @@
       if (!drupal_check_module($module)) {
         unset($new_modules[$key]);
       }
-      $sort[$module] = $files[$module]->sort;
+      else {
+        // Only add modules to enable to $sort or array_multisort fails.
+        $sort[$module] = $files[$module]->sort;
+      }
     }
     array_multisort($sort, $new_modules);
     drupal_install_modules($new_modules);
