Merge branch 'MDL-34607-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE
This commit is contained in:
@@ -959,5 +959,15 @@ function xmldb_main_upgrade($oldversion) {
|
||||
upgrade_main_savepoint(true, 2012062501.14);
|
||||
}
|
||||
|
||||
if ($oldversion < 2012062502.02) {
|
||||
// Some folders still have a sortorder set, which is used for main files but is not
|
||||
// supported by the folder resource. We reset the value here.
|
||||
$sql = 'UPDATE {files} SET sortorder = ? WHERE component = ? AND filearea = ? AND sortorder <> ?';
|
||||
$DB->execute($sql, array(0, 'mod_folder', 'content', 0));
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2012062502.02);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ class file_storage {
|
||||
*/
|
||||
public function get_area_tree($contextid, $component, $filearea, $itemid) {
|
||||
$result = array('dirname'=>'', 'dirfile'=>null, 'subdirs'=>array(), 'files'=>array());
|
||||
$files = $this->get_area_files($contextid, $component, $filearea, $itemid, "sortorder, itemid, filepath, filename", true);
|
||||
$files = $this->get_area_files($contextid, $component, $filearea, $itemid, "itemid, filepath, filename", true);
|
||||
// first create directory structure
|
||||
foreach ($files as $hash=>$dir) {
|
||||
if (!$dir->is_directory()) {
|
||||
|
||||
Reference in New Issue
Block a user