MDL-67494 calendar: step to set userid 0 to all shared events

This commit is contained in:
Simey Lameze
2021-03-03 16:06:32 +08:00
parent a3e2601675
commit ba04a79ac6
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -2458,5 +2458,17 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2021052500.60);
}
if ($oldversion < 2021052500.64) {
// This upgrade step will update all shared events setting userid to 0.
// Site, category, course, group and action events (except user overrides) dont belong to the user who creates them.
$DB->execute("UPDATE {event} SET userid = 0 WHERE eventtype <> 'user' OR priority <> 0");
// Only user type of subscription should record user id.
$DB->execute("UPDATE {event_subscriptions} SET userid = 0 WHERE eventtype <> 'user'");
// Main savepoint reached.
upgrade_main_savepoint(true, 2021052500.64);
}
return true;
}
+1 -1
View File
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2021052500.63; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2021052500.64; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev (Build: 20210226)'; // Human-friendly version name