Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'w09_MDL-26616_20_resourcelinks' of git://github.com/sko…

…dak/moodle
  • Loading branch information...
commit 847753d4973f7363bec23ef78bf7553aa8e74a22 2 parents 8ef8ec6 + 3d8f1d3
@stronk7 stronk7 authored
View
7 mod/resource/db/upgrade.php
@@ -255,5 +255,12 @@ function xmldb_resource_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2010083000, 'resource');
}
+ if ($oldversion < 2011022700) {
+ // refresh resource links breakage caused by invalid sortorder
+ require_once($CFG->dirroot . '/course/lib.php');
+ rebuild_course_cache(0, true);
+ upgrade_mod_savepoint(true, 2011022700, 'resource');
+ }
+
return true;
}
View
2  mod/resource/lib.php
@@ -247,7 +247,7 @@ function resource_get_coursemodule_info($coursemodule) {
return $info;
}
$fs = get_file_storage();
- $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder');
+ $files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false); // TODO: this is not very efficient!!
if (count($files) >= 1) {
$mainfile = array_pop($files);
$info->icon = file_extension_icon($mainfile->get_filename());
View
8 mod/resource/version.php
@@ -26,7 +26,7 @@
defined('MOODLE_INTERNAL') || die;
-$module->version = 2010101400;
-$module->requires = 2010080300; // Requires this Moodle version
-$module->cron = 0;
-
+$module->version = 2011022700;
+$module->requires = 2010080300; // Requires this Moodle version
+$module->cron = 0;
+$module->component = 'mod_resource';
Please sign in to comment.
Something went wrong with that request. Please try again.