Skip to content

Commit

Permalink
MDL-43797 lib/db/upgrade.php: Remove custom pages for deleted users
Browse files Browse the repository at this point in the history
Change-Id: Ifef563431682a2a5524927f85ca9eba9cbe520ff
  • Loading branch information
DavidCurry committed Jan 27, 2014
1 parent 72d1ccf commit a5ab83a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -2927,5 +2927,18 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2014011701.00);
}

if ($oldversion < 2014012300.01) {
// 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);

// Reached main savepoint.
upgrade_main_savepoint(true, 2014012300.01);
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2014012300.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2014012300.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

Expand Down

0 comments on commit a5ab83a

Please sign in to comment.