Bug 24913 - Add option to require users to enter email address twice during self-registration.
Summary: Add option to require users to enter email address twice during self-registra...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-20 13:24 UTC by Katrin Fischer
Modified: 2020-11-30 21:48 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement, when enabled, requires users self-registering via the OPAC to manually enter their primary email address twice. This is to prevent users from incorrectly entering their email address and consequentially never receiving a verification email from the library. **New system preference**: `PatronSelfRegistrationConfirmEmail` defaults to disabled.
Version(s) released in:
20.05.00


Attachments
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref (9.01 KB, patch)
2020-04-14 05:22 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref (9.13 KB, patch)
2020-04-14 20:17 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Error when trying to submit self- reg. form with matching emails (15.99 KB, text/plain)
2020-04-15 13:21 UTC, Holly
Details
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref (9.66 KB, patch)
2020-04-19 22:07 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref (9.69 KB, patch)
2020-04-20 11:04 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Warning with javascript (13.45 KB, image/png)
2020-04-20 11:09 UTC, Holly
Details
Warning without javascript (27.50 KB, image/png)
2020-04-20 11:10 UTC, Holly
Details
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref (9.74 KB, patch)
2020-04-20 15:07 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-03-20 13:24:01 UTC
A number of patrons don't enter their email address correctly in the self registration form in the OPAC and don't receive the verification emails. 
It would be nice if Koha asked for the email address to be entered twice (with no copy allowed?) to help avoid typos.
Comment 1 Martin Renvoize 2020-04-03 11:40:27 UTC
This is a great idea and will bring us more inline with how the rest of the internets works ;)
Comment 2 Aleisha Amohia 2020-04-14 05:22:56 UTC
Created attachment 102891 [details] [review]
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref

To test:
1) update database, restart memcached/plack
2) Go to Administration -> System preferences -> OPAC tab. Enable the
new PatronSelfRegistrationConfirmEmail system preference. Enable other
required self registration sysprefs.
3) Go to the OPAC home page. (You may need to log out). Click the
'Register' link so you are redirected to the member entry form.
4) Notice the 'Confirm primary email' field after the 'primary email'
field. Put 'a@a.com' in primary email, and 'b@b.com' in the confirm
field. Scroll to the end of the form and Submit.
5) Confirm the form is not successfully submitted, and an error message
is shown to indicate the email addresses do not match.
6) Confirm you cannot cut, copy or paste in either the primary email or
confirm primary email fields. Confirm the right click menu doesn't work
in these fields.

7) Disable javascript in your browser.
8) Repeat steps 3 and 4.
9) Confirm there is an error message to indicate the email addresses do
not match.

10) Re-enable javascript. Fill in the form correctly with matching email
addresses and confirm it successfully submits.

11) Disable the PatronSelfRegistrationConfirmEmail syspref.
12) Attempt to register an account on the OPAC again. Confirm the
'confirm email address' field is gone and form works as expected.

Sponsored-by: TBC (just checking)
Comment 3 Aleisha Amohia 2020-04-14 20:17:06 UTC
Created attachment 102946 [details] [review]
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref

To test:
1) update database, restart memcached/plack
2) Go to Administration -> System preferences -> OPAC tab. Enable the
new PatronSelfRegistrationConfirmEmail system preference. Enable other
required self registration sysprefs.
3) Go to the OPAC home page. (You may need to log out). Click the
'Register' link so you are redirected to the member entry form.
4) Notice the 'Confirm primary email' field after the 'primary email'
field. Put 'a@a.com' in primary email, and 'b@b.com' in the confirm
field. Scroll to the end of the form and Submit.
5) Confirm the form is not successfully submitted, and an error message
is shown to indicate the email addresses do not match.
6) Confirm you cannot cut, copy or paste in either the primary email or
confirm primary email fields. Confirm the right click menu doesn't work
in these fields.

7) Disable javascript in your browser.
8) Repeat steps 3 and 4.
9) Confirm there is an error message to indicate the email addresses do
not match.

10) Re-enable javascript. Fill in the form correctly with matching email
addresses and confirm it successfully submits.

11) Disable the PatronSelfRegistrationConfirmEmail syspref.
12) Attempt to register an account on the OPAC again. Confirm the
'confirm email address' field is gone and form works as expected.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 4 Holly 2020-04-15 13:21:31 UTC
Created attachment 103002 [details]
Error when trying to submit self- reg. form with matching emails

During testing steps 1-9 worked successfully but when trying to submit the form with matching emails in the "primary email" and "confirm primary email" fields the attached error appears.
Comment 5 Owen Leonard 2020-04-15 14:04:41 UTC
I got a similar error:

DBIx::Class::Row::store_column(): No such column 'repeat_email' on Koha::Schema::Result::BorrowerModification at /kohadevbox/koha/Koha/Object.pm line 77
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Comment 6 Martin Renvoize 2020-04-15 16:15:19 UTC
This also feels like we could give faster feedback to the end-user. I like that we fully catch it on the serverside.. but it would be nice to also catch it clientside before submission?

We already have jquery validation as a dependency.. unless my memory is failing me I think it has a very simple way to do this sort of matching validation.
Comment 7 Owen Leonard 2020-04-15 17:31:25 UTC
(In reply to Martin Renvoize from comment #6)
> This also feels like we could give faster feedback to the end-user.

It has JS validation and it works correctly. I only ran into the error because I was testing with JS disabled.
Comment 8 Martin Renvoize 2020-04-15 20:19:52 UTC
My mistake on the JS front then.. reading the patches it just looked like it disabled copy and paste for the inputs.
Comment 9 Katrin Fischer 2020-04-17 14:36:07 UTC
Hi Aleisha (and everyone involved so far :) ) 

I did some more testing here:

- QA tools pass
- Syspref is added in all the right places
- With the feature disabled, both registering new patrons and making change requests for existing patrons work fine
- Javascript check works fine on self reg

2 issues found:

1) When the the feature is active, you get the error other have already reported on saving the form.

DBIx::Class::Row::store_column(): No such column 'repeat_email' on Koha::Schema::Result::Borrower at /home/vagrant/kohaclone/Koha/Object.pm line 77
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

2) When the pref is active and the patron changes address etc in the OPAC, the second email input field doesn't show (I think that is ok, as this is a 'selfreg* feature). But: When you change the email and try to save, you get an error:

The following fields contain invalid information:

    Emails do not match! confirm email address

Please correct and resubmit. 

We might be missing a check somewhere for "only do this for self registrations".
Comment 10 Aleisha Amohia 2020-04-19 22:07:37 UTC
Created attachment 103226 [details] [review]
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref

To test:
1) update database, restart memcached/plack
2) Go to Administration -> System preferences -> OPAC tab. Enable the
new PatronSelfRegistrationConfirmEmail system preference. Enable other
required self registration sysprefs.
3) Go to the OPAC home page. (You may need to log out). Click the
'Register' link so you are redirected to the member entry form.
4) Notice the 'Confirm primary email' field after the 'primary email'
field. Put 'a@a.com' in primary email, and 'b@b.com' in the confirm
field. Scroll to the end of the form and Submit.
5) Confirm the form is not successfully submitted, and an error message
is shown to indicate the email addresses do not match.
6) Confirm you cannot cut, copy or paste in either the primary email or
confirm primary email fields. Confirm the right click menu doesn't work
in these fields.

7) Disable javascript in your browser.
8) Repeat steps 3 and 4.
9) Confirm there is an error message to indicate the email addresses do
not match.

10) Re-enable javascript. Fill in the form correctly with matching email
addresses and confirm it successfully submits.

11) Disable the PatronSelfRegistrationConfirmEmail syspref.
12) Attempt to register an account on the OPAC again. Confirm the
'confirm email address' field is gone and form works as expected.
13) Re-enable the PatronSelfRegistrationConfirmEmail syspref.
14) Log in to the OPAC and go to your personal details
15) Edit the primary email field
16) Confirm you are able to submit your changes (you should not see an
error about emails not matching).

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 11 ByWater Sandboxes 2020-04-20 11:04:04 UTC
Created attachment 103273 [details] [review]
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref

To test:
1) update database, restart memcached/plack
2) Go to Administration -> System preferences -> OPAC tab. Enable the
new PatronSelfRegistrationConfirmEmail system preference. Enable other
required self registration sysprefs.
3) Go to the OPAC home page. (You may need to log out). Click the
'Register' link so you are redirected to the member entry form.
4) Notice the 'Confirm primary email' field after the 'primary email'
field. Put 'a@a.com' in primary email, and 'b@b.com' in the confirm
field. Scroll to the end of the form and Submit.
5) Confirm the form is not successfully submitted, and an error message
is shown to indicate the email addresses do not match.
6) Confirm you cannot cut, copy or paste in either the primary email or
confirm primary email fields. Confirm the right click menu doesn't work
in these fields.

7) Disable javascript in your browser.
8) Repeat steps 3 and 4.
9) Confirm there is an error message to indicate the email addresses do
not match.

10) Re-enable javascript. Fill in the form correctly with matching email
addresses and confirm it successfully submits.

11) Disable the PatronSelfRegistrationConfirmEmail syspref.
12) Attempt to register an account on the OPAC again. Confirm the
'confirm email address' field is gone and form works as expected.
13) Re-enable the PatronSelfRegistrationConfirmEmail syspref.
14) Log in to the OPAC and go to your personal details
15) Edit the primary email field
16) Confirm you are able to submit your changes (you should not see an
error about emails not matching).

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)

Signed-off-by: holly <hc@interleaf.ie>
Comment 12 Holly 2020-04-20 11:09:29 UTC
Created attachment 103274 [details]
Warning with javascript

I signed this off, but I do have one small thing to point out. When I tried submitting with mis-matched emails with Javascript enabled I got a warning beside the confirm primary email field. 

When I tried submitting with mis-matched emails with Javascript disabled I got a warning at the top of the form, advising me the emails were not matching.

Should the warning be the same in both cases?
Comment 13 Holly 2020-04-20 11:10:58 UTC
Created attachment 103275 [details]
Warning without javascript

Warning without javascript
Comment 14 Katrin Fischer 2020-04-20 11:22:10 UTC
Hi Holly, 

thx for testing!

I think that behaviour matches how we do it in other places. When you submit the form without JavaScript, the server will validate the entries and put the warning on top when reloading the page.
Comment 15 Holly 2020-04-20 11:24:28 UTC
Thanks for explaining Katrin. I've changed the status on the bug as signed off.
Comment 16 Katrin Fischer 2020-04-20 15:07:32 UTC
Created attachment 103308 [details] [review]
Bug 24913: Add PatronSelfRegistrationConfirmEmail syspref

To test:
1) update database, restart memcached/plack
2) Go to Administration -> System preferences -> OPAC tab. Enable the
new PatronSelfRegistrationConfirmEmail system preference. Enable other
required self registration sysprefs.
3) Go to the OPAC home page. (You may need to log out). Click the
'Register' link so you are redirected to the member entry form.
4) Notice the 'Confirm primary email' field after the 'primary email'
field. Put 'a@a.com' in primary email, and 'b@b.com' in the confirm
field. Scroll to the end of the form and Submit.
5) Confirm the form is not successfully submitted, and an error message
is shown to indicate the email addresses do not match.
6) Confirm you cannot cut, copy or paste in either the primary email or
confirm primary email fields. Confirm the right click menu doesn't work
in these fields.

7) Disable javascript in your browser.
8) Repeat steps 3 and 4.
9) Confirm there is an error message to indicate the email addresses do
not match.

10) Re-enable javascript. Fill in the form correctly with matching email
addresses and confirm it successfully submits.

11) Disable the PatronSelfRegistrationConfirmEmail syspref.
12) Attempt to register an account on the OPAC again. Confirm the
'confirm email address' field is gone and form works as expected.
13) Re-enable the PatronSelfRegistrationConfirmEmail syspref.
14) Log in to the OPAC and go to your personal details
15) Edit the primary email field
16) Confirm you are able to submit your changes (you should not see an
error about emails not matching).

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)

Signed-off-by: holly <hc@interleaf.ie>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Martin Renvoize 2020-04-21 11:31:51 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 18 Joy Nelson 2020-05-07 21:56:57 UTC
enhancement not backported to 19.11.x