mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-76536' of https://github.com/paulholden/moodle
This commit is contained in:
commit
3218a8feda
@ -3034,5 +3034,16 @@ privatefiles,moodle|/user/files.php';
|
||||
// Automatically generated Moodle v4.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2022120900.01) {
|
||||
|
||||
// Remove any orphaned role assignment records (pointing to non-existing roles).
|
||||
$DB->delete_records_select('role_assignments', 'NOT EXISTS (
|
||||
SELECT r.id FROM {role} r WHERE r.id = {role_assignments}.roleid
|
||||
)');
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2022120900.01);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1211,8 +1211,12 @@ function enrol_try_internal_enrol($courseid, $userid, $roleid = null, $timestart
|
||||
if (!$instances = $DB->get_records('enrol', array('enrol'=>'manual', 'courseid'=>$courseid, 'status'=>ENROL_INSTANCE_ENABLED), 'sortorder,id ASC')) {
|
||||
return false;
|
||||
}
|
||||
$instance = reset($instances);
|
||||
|
||||
if ($roleid && !$DB->record_exists('role', ['id' => $roleid])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$instance = reset($instances);
|
||||
$enrol->enrol_user($instance, $userid, $roleid, $timestart, $timeend);
|
||||
|
||||
return true;
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2022120900.00; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
$version = 2022120900.01; // YYYYMMDD = weekly release date of this DEV branch.
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '4.2dev (Build: 20221209)'; // Human-friendly version name
|
||||
|
Loading…
x
Reference in New Issue
Block a user