Skip to content
Permalink
Browse files

Merge branch 'MDL-31541_multiple_repository_instances' of git://githu…

…b.com/davosmith/moodle
  • Loading branch information...
Aparup Banerjee
Aparup Banerjee committed Feb 14, 2012
2 parents b7bf2c3 + fdb0322 commit 9e31e848da9eb9925064dd74b8bb22fad338e843
Showing with 4 additions and 1 deletion.
  1. +4 −1 repository/lib.php
@@ -818,6 +818,9 @@ public static function get_instances($args = array()) {
} else {
$accepted_types = '*';
}
// Sortorder should be unique, which is not true if we use $record->sortorder
// and there are multiple instances of any repository type
$sortorder = 1;
foreach ($records as $record) {
if (!file_exists($CFG->dirroot . '/repository/'. $record->repositorytype.'/lib.php')) {
continue;
@@ -826,7 +829,7 @@ public static function get_instances($args = array()) {
$options['visible'] = $record->visible;
$options['type'] = $record->repositorytype;
$options['typeid'] = $record->typeid;
$options['sortorder'] = $record->sortorder;
$options['sortorder'] = $sortorder++;
// tell instance what file types will be accepted by file picker
$classname = 'repository_' . $record->repositorytype;

0 comments on commit 9e31e84

Please sign in to comment.
You can’t perform that action at this time.