Commit 13d5f9a5 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>
(cherry picked from commit 4adf4a01)
(cherry picked from commit 6905c539)
parent 5b0e6d53
...@@ -1038,9 +1038,10 @@ function requiredfields_submit(Pieform $form, $values) { ...@@ -1038,9 +1038,10 @@ function requiredfields_submit(Pieform $form, $values) {
$oldemail = get_field('usr', 'email', 'id', $USER->get('id')); $oldemail = get_field('usr', 'email', 'id', $USER->get('id'));
if ($oldemail == 'admin@example.org') { if ($oldemail == 'admin@example.org') {
// we are dealing with the dummy email that is set on install // 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_internal_profile_email', array('email' => $email), array('owner' => $USER->get('id')));
update_record('artefact', array('title' => $email), array('owner' => $USER->get('id'), 'artefacttype' => 'email')); 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 // 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