Bug 19366 - PatronSelfRegistrationEmailMustBeUnique pref makes it impossible to submit updates via OPAC
Summary: PatronSelfRegistrationEmailMustBeUnique pref makes it impossible to submit up...
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Kyle M Hall
URL:
Whiteboard:
Keywords:
Depends on: 16275
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-25 14:10 UTC by Owen Leonard
Modified: 2017-10-18 21:21 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19366: Do not block patron's detail update if EmailMustBeUnique (2.47 KB, patch)
2017-09-27 16:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19366: Do not block patron's detail update if EmailMustBeUnique (2.57 KB, patch)
2017-09-28 04:24 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 19366: Do not block patron's detail update if EmailMustBeUnique (2.62 KB, patch)
2017-09-29 12:06 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2017-09-25 14:10:19 UTC
With  PatronSelfRegistrationEmailMustBeUnique set to "Consider" I am unable to submit a change to my patron record via the OPAC because Koha performs the existing-email check on the email in the existing record I'm modifying.

PatronSelfRegistrationEmailMustBeUnique should only apply new registrations.
Comment 1 Jonathan Druart 2017-09-27 16:49:46 UTC
Created attachment 67404 [details] [review]
Bug 19366: Do not block patron's detail update if EmailMustBeUnique

If the pref PatronSelfRegistrationEmailMustBeUnique is set ("consider"),
a patron is not allowed to register with an existing email address.
The existing code is wrong and reject a patron that is updating their
personal details with "This email address already exists in our
database.", even if the patron did not modify their email address.

This is caused by the query we made, we must search for patron with this
email address but who is not the current patron.

Test plan:
- Set PatronSelfRegistrationEmailMustBeUnique to "consider"
- Register a new patron with an existing email address
=> you should not be allowed
- Use a non-existent email address
=> You should be allowed
- Edit your patron details
- Modify some infos
=> Should pass
- Modify your email address with an existing one
=> You should not be allowed to do that
Comment 2 Alex Buckley 2017-09-28 04:24:11 UTC
Created attachment 67424 [details] [review]
Bug 19366: Do not block patron's detail update if EmailMustBeUnique

If the pref PatronSelfRegistrationEmailMustBeUnique is set ("consider"),
a patron is not allowed to register with an existing email address.
The existing code is wrong and reject a patron that is updating their
personal details with "This email address already exists in our
database.", even if the patron did not modify their email address.

This is caused by the query we made, we must search for patron with this
email address but who is not the current patron.

Test plan:
- Set PatronSelfRegistrationEmailMustBeUnique to "consider"
- Register a new patron with an existing email address
=> you should not be allowed
- Use a non-existent email address
=> You should be allowed
- Edit your patron details
- Modify some infos
=> Should pass
- Modify your email address with an existing one
=> You should not be allowed to do that

Followed test plan, patches worked as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Comment 3 Kyle M Hall 2017-09-29 12:06:41 UTC
Created attachment 67442 [details] [review]
Bug 19366: Do not block patron's detail update if EmailMustBeUnique

If the pref PatronSelfRegistrationEmailMustBeUnique is set ("consider"),
a patron is not allowed to register with an existing email address.
The existing code is wrong and reject a patron that is updating their
personal details with "This email address already exists in our
database.", even if the patron did not modify their email address.

This is caused by the query we made, we must search for patron with this
email address but who is not the current patron.

Test plan:
- Set PatronSelfRegistrationEmailMustBeUnique to "consider"
- Register a new patron with an existing email address
=> you should not be allowed
- Use a non-existent email address
=> You should be allowed
- Edit your patron details
- Modify some infos
=> Should pass
- Modify your email address with an existing one
=> You should not be allowed to do that

Followed test plan, patches worked as described
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Jonathan Druart 2017-09-29 15:49:36 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 5 Fridolin SOMERS 2017-10-17 08:12:51 UTC
Pushed to 17.05.x, will be in 17.05.05.
Comment 6 Katrin Fischer 2017-10-18 21:21:20 UTC
This patch has been pushed to 16.11.x and will be in 16.11.13.