mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-50955-311' of git://github.com/peterRd/moodle into MOODLE_311_STABLE
This commit is contained in:
commit
c6e649f5ed
2 changed files with 19 additions and 1 deletions
|
@ -2998,5 +2998,23 @@ function xmldb_main_upgrade($oldversion) {
|
|||
// Automatically generated Moodle v3.10.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2020111500.01) {
|
||||
// Get all lessons that are set with a completion criteria of 'requires grade' but with no grade type set.
|
||||
$sql = "SELECT cm.id
|
||||
FROM {course_modules} cm
|
||||
JOIN {lesson} l ON l.id = cm.instance
|
||||
JOIN {modules} m ON m.id = cm.module
|
||||
WHERE m.name = :name AND cm.completiongradeitemnumber IS NOT NULL AND l.grade = :grade";
|
||||
|
||||
do {
|
||||
if ($invalidconfigrations = $DB->get_records_sql($sql, ['name' => 'lesson', 'grade' => 0], 0, 1000)) {
|
||||
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($invalidconfigrations), SQL_PARAMS_NAMED);
|
||||
$DB->set_field_select('course_modules', 'completiongradeitemnumber', null, "id $insql", $inparams);
|
||||
}
|
||||
} while ($invalidconfigrations);
|
||||
|
||||
upgrade_main_savepoint(true, 2020111500.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2020111500.00; // 20201109 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2020111500.01; // 20201109 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '3.11dev (Build: 20201115)';// Human-friendly version name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue