From 7970c217511e876fdc86e875b73d65b6df2ade5d Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Fri, 10 Oct 2014 15:30:12 +0800 Subject: [PATCH] MDL-46576 core_grades: Fix upgrade to natural weight. When upgrading from 'Sum of grades' to natural aggregation the weights were no automatically assigned and the grade totals were wrong. This has now been rectified. --- lib/db/upgrade.php | 3 +++ version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 5920ca12f44..7f8cbc7a445 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -3918,6 +3918,9 @@ function xmldb_main_upgrade($oldversion) { foreach ($courses as $course) { set_config('show_sumofgrades_upgrade_' . $course->courseid, 1); + // Set each of the grade items to needing an update so that when the user visits the grade reports the + // figures will be updated. + $DB->set_field('grade_items', 'needsupdate', 1, array('courseid' => $course->courseid)); } set_config('grades_sumofgrades_upgrade_flagged', 1); diff --git a/version.php b/version.php index f3877787608..d856739876b 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2014100800.02; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2014100800.07; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.