← Back to team overview

mahara-contributors team mailing list archive

[Bug 1966138] A patch has been submitted for review

 

Patch for "22.04_DEV" branch:
https://reviews.mahara.org/c/mahara/+/12622

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: mahara-contributors
https://bugs.launchpad.net/bugs/1966138

Title:
  The set_profile_field() function for email doesn't check for doubleups

Status in Mahara:
  Fix Committed
Status in Mahara 20.10 series:
  In Progress
Status in Mahara 21.04 series:
  In Progress
Status in Mahara 21.10 series:
  In Progress
Status in Mahara 22.04 series:
  Fix Committed

Bug description:
  If I have an account where there is only one email address and I call
  the set_profile_field() to update the account to a new email address,
  eg set_profile_field($userid, 'email', $newemail);

  It will update the person to have the new email address as their
  primary address.

  However, if I have the situation where the person already has two addresses, say:
  e1@xxxxxxxxxxx and e2@xxxxxxxxxxx where e1@xxxxxxxxxxx is the primary email

   id | artefact_email | artefact_id | artefact_internal_profile_email | principal 
  ----+----------------+-------------+---------------------------------+-----------
    7 | e1@xxxxxxxxxxx |           7 | e1@xxxxxxxxxxx                  |         1
    8 | e2@xxxxxxxxxxx |           8 | e2@xxxxxxxxxxx                  |         0

  and I try to update the email via set_profile_field($userid, 'email', 'e2@xxxxxxxxxxx');
  the function fetches the primary address one and tries to update it to the new address and I end up with:

  
   id | artefact_email | artefact_id | artefact_internal_profile_email | principal 
  ----+----------------+-------------+---------------------------------+-----------
    7 | e2@xxxxxxxxxxx |           7 | e1@xxxxxxxxxxx                  |         1
    8 | e2@xxxxxxxxxxx |           8 | e2@xxxxxxxxxxx                  |         0

  Where there is a mismatch on the primary email line.

  We need the set_profile_field() for email to check that the email
  value we are setting the primary email to doesn't already exist for
  this person as one of their secondary emails

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1966138/+subscriptions



References