Bug 22458 - PatronSelfRegistrationEmailMustBeUnique disallows self modification requests if multiple accounts share an email address
Summary: PatronSelfRegistrationEmailMustBeUnique disallows self modification requests ...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Matt Blenkinsop
URL:
Keywords:
Depends on: 16275
Blocks:
  Show dependency treegraph
 
Reported: 2019-03-05 15:22 UTC by Jason Robb
Modified: 2025-04-11 07:55 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 22458: Don't check for duplicate email on borrower self modification (2.95 KB, patch)
2025-04-02 11:58 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 22458: Don't check for duplicate email on borrower self modification (3.00 KB, patch)
2025-04-02 19:23 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 22458: Don't check for duplicate email on borrower self modification (3.00 KB, patch)
2025-04-03 08:21 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 22458: Don't check for duplicate email on borrower self modification (3.07 KB, patch)
2025-04-03 08:22 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Robb 2019-03-05 15:22:10 UTC
PatronSelfRegistrationEmailMustBeUnique causes unexpected behavior on the patron self modification screen ("your personal details") in the OPAC.

When enabled, the system preference blocks existing accounts from submitting account modification requests if the primary email associated with the account is also associated with another account in the database.

This means if a parent account and a child account both use the same email address, neither can submit account modification requests via the OPAC.

This system preference should only affect new self registered accounts.

To reproduce this behavior:
1. Set PatronSelfRegistrationEmailMustBeUnique to 'Consider'
2. Create two different accounts with the same primary email address
3. Log into the OPAC with either account
4. Visit "your personal details"
5. Make a change unrelated to email address and submit
6. The submission is blocked with a message about duplicate email addresses
Comment 1 Chris Slone 2021-08-23 17:31:41 UTC
Can confirm that this is an issue.
Comment 2 Andrew Fuerste-Henry 2025-03-31 16:09:37 UTC
It's clear from bug 16275 that this check was only meant to apply to self-registration, not self-modification. We should make this system preference only impact self-registration.
Comment 3 Nick Clemens (kidclamp) 2025-04-02 11:58:13 UTC
Created attachment 180306 [details] [review]
Bug 22458: Don't check for duplicate email on borrower self modification

This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email
Comment 4 Andrew Fuerste-Henry 2025-04-02 19:23:53 UTC
Created attachment 180424 [details] [review]
Bug 22458: Don't check for duplicate email on borrower self modification

This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email

Signed-off-by: Guillen, Allax <AGuillen@roseville.ca.us>
Comment 5 Matt Blenkinsop 2025-04-03 08:21:44 UTC
Created attachment 180443 [details] [review]
Bug 22458: Don't check for duplicate email on borrower self modification

This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email

Signed-off-by: Guillen, Allax <AGuillen@roseville.ca.us>
Comment 6 Matt Blenkinsop 2025-04-03 08:22:17 UTC
Created attachment 180444 [details] [review]
Bug 22458: Don't check for duplicate email on borrower self modification

This patch adds an extra variable to internal function CheckValidBorrower to set the
context as 'create' or 'update'

To test:
1 - Enable PatronSelfRegistrationEmailMustBeUnique
2 - Edit a patron in staff interface and set email to 'a@example.org'
3 - Open an incognito window and go to opac
4 - Self register a patron using email a@example.org
5 - You receive an error
6 - Use b@example.org for email
7 - No problem
8 - Sign in as the new patron
9 - Edit your information
10 - Set email to a@example.org
11 - You receive an error
12 - Apply patch, restart all
13 - Edit patron again
14 - No error!
15 - Register another patron on the opac
16 - Confirm still wanred if using a@example.org as the email

Signed-off-by: Guillen, Allax <AGuillen@roseville.ca.us>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Comment 7 Katrin Fischer 2025-04-11 07:55:37 UTC
Pushed for 25.05!

Well done everyone, thank you!