Commit 4adf4a01 authored by Robert Lyon's avatar Robert Lyon

Bug 1761037: Commit the email update on first install correctly

Rather than update db directly - we need to update the USER object

behatnotneeded

Change-Id: I31f8c6759dd621439c90ddc0f0dc8a344359d5d9
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 2171fcb8
......@@ -1182,9 +1182,10 @@ function requiredfields_submit(Pieform $form, $values) {
$oldemail = get_field('usr', 'email', 'id', $USER->get('id'));
if ($oldemail == 'admin@example.org') {
// we are dealing with the dummy email that is set on install
update_record('usr', array('email' => $email), array('id' => $USER->get('id')));
update_record('artefact_internal_profile_email', array('email' => $email), array('owner' => $USER->get('id')));
update_record('artefact', array('title' => $email), array('owner' => $USER->get('id'), 'artefacttype' => 'email'));
$USER->email = $email;
$USER->commit();
}
}
// Check if a validation email has been sent, if not send one
......
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