Permalink
Browse files

MDL-43797 lib/db/upgrade.php: Remove custom pages for deleted users

Change-Id: Ief5ec1dd0930e55b6f0bf2e0d2caa3febec07b18
  • Loading branch information...
DavidCurry committed Jan 22, 2014
1 parent ee7d0bb commit ade2c991095fa5e2205ac8a545b066f917b8e24b
Showing with 14 additions and 1 deletion.
  1. +13 −0 lib/db/upgrade.php
  2. +1 −1 version.php
View
@@ -2911,5 +2911,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013111801.02);
}
+ if ($oldversion < 2013111801.04) {
+ // Remove deleted users home pages.
+ $active = $DB->get_fieldset_select('user', 'id', 'deleted = ?', array(0));
+ list($insql, $params) = $DB->get_in_or_equal($active, SQL_PARAMS_QM, 'param', false);
+ $sql = 'DELETE FROM {my_pages}
+ WHERE userid ' . $insql;
+
+ $DB->execute($sql, $params);
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2013111801.04);
+ }
+
return true;
}
View
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2013111801.03; // 20131118 = branching date YYYYMMDD - do not modify!
+$version = 2013111801.04; // 20131118 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

0 comments on commit ade2c99

Please sign in to comment.