Commit b8abf335 authored by Robert Lyon's avatar Robert Lyon
Browse files

Clean expired passwords causes error when upgrading (bug 1369370)



When upgrading, should only check if the cron job
'auth_clean_expired_password_requests' already exists
in the table - without all the other fields that need to be updated.
Otherwise, it will check on all the fields (i.e. minute, hour, etc).
If the admin updated them,
the check won't match and a duplicate error results.

Change-Id: I2d30ac97e9a82aaf0d538a834396fdc2d2757480
Signed-off-by: default avatarGhada El-Zoghbi <ghada@catalyst-au.net>
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 63b17aaa
...@@ -3167,6 +3167,7 @@ function xmldb_core_upgrade($oldversion=0) { ...@@ -3167,6 +3167,7 @@ function xmldb_core_upgrade($oldversion=0) {
} }
if ($oldversion < 2014032709) { if ($oldversion < 2014032709) {
$where = array('callfunction' => 'auth_clean_expired_password_requests');
$data = array('callfunction' => 'auth_clean_expired_password_requests', $data = array('callfunction' => 'auth_clean_expired_password_requests',
'minute' => '5', 'minute' => '5',
'hour' => '0', 'hour' => '0',
...@@ -3174,7 +3175,7 @@ function xmldb_core_upgrade($oldversion=0) { ...@@ -3174,7 +3175,7 @@ function xmldb_core_upgrade($oldversion=0) {
'month' => '*', 'month' => '*',
'dayofweek' => '*', 'dayofweek' => '*',
); );
ensure_record_exists('cron', (object)$data, (object)$data); ensure_record_exists('cron', (object)$where, (object)$data);
} }
// Delete leftover data which are not associated to any institution // Delete leftover data which are not associated to any institution
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment