LEAP2 import does not check if the new user email is already used in Mahara
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Confirmed
|
Medium
|
Unassigned |
Bug Description
When importing a LEAP2 zip into a 1.5 Mahara site (latest 1.5.0dev from git) and if the new user email is already known, importation proceeds normally but the mahara site then starts to fail in various places (search friends, see groups members) ...
Errors reported in httpd error_log are :
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] [WAR] a9 (lib/errors.
ahara/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] Call stack (most recent first):, referer: http://
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * log_message(
at /var/www/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * log_warn(
mahara.
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * SQLException-
at /var/www/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * get_record_
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * get_record("usr", "email", "<email address hidden>") at /var/www/
cs/local/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * local_remote_
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * remote_
mahara/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * profile_
woo/mahara/
[Thu Jan 26 10:22:19 2012] [error] [client 134.214.152.108] * Dwoo_Plugin_
k/maharadata/
It is also impossible to delete that user under site administration since getting that user data fails with the above error...
To return site to 'normal operation' one has to go to table usr and manually edit the new user email to an unique value
Cheers.
Edit : I did not tested it yet, but I do hope that this behaviour does not occur also in importing users from a CSV file ;-)
description: | updated |
description: | updated |
tags: |
added: leap2a removed: leap2 unicity |
Changed in mahara: | |
status: | New → Triaged |
importance: | Undecided → Medium |
milestone: | none → 1.5.0 |
Changed in mahara: | |
milestone: | none → 1.6.0 |
Changed in mahara: | |
assignee: | nobody → Son Nguyen (ngson2000) |
Changed in mahara: | |
milestone: | 1.6.0 → none |
Changed in mahara: | |
assignee: | Son Nguyen (ngson2000) → nobody |
Hi Patrick,
Unfortunately uniqueness of email addresses is not enforced at the db level yet. We may look at fixing that in future, but first I think we'd need to do a bit of work around how to upgrade old databases. In the meantime you should just avoid relying on uniqueness in your custom code.
If you find any core code relying on uniqueness of emails (you mentioned search friends, and see groups members), let us know in another bug report, and we'll fix it for 1.5.
See also https:/ /bugs.launchpad .net/mahara/ +bug/903494, https:/ /bugs.launchpad .net/mahara/ +bug/907903