Revert "MDL-31000 Respect sortorder of repositories when displaying the filepicker"
authorSam Hemelryk <sam@moodle.com>
Mon, 9 Jan 2012 23:18:34 +0000 (12:18 +1300)
committerSam Hemelryk <sam@moodle.com>
Mon, 9 Jan 2012 23:18:34 +0000 (12:18 +1300)
This change was reverted because the array keys need to be the id, existing code relies on this.
This reverts commit ef72c7942e69b41296989bbbd51a0d84ee4f636b.

repository/lib.php

index 786826b..67b1a13 100644 (file)
@@ -2146,7 +2146,7 @@ function initialise_filepicker($args) {
     $return->return_types = $args->return_types;
     foreach ($repositories as $repository) {
         $meta = $repository->get_meta();
-        $return->repositories[] = $meta;
+        $return->repositories[$repository->id] = $meta;
     }
     return $return;
 }