Bug 26267

Summary: Add jQuery validator to memberentrygen.tt
Product: Koha Reporter: Timothy Alexis Vass <timothy_alexis.vass>
Component: PatronsAssignee: Timothy Alexis Vass <timothy_alexis.vass>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, joonas.kylmala, kyle
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 26267: Add jQuery validator to memberentrygen.tt
Bug 26267: Add jQuery validator to memberentrygen.tt
Bug 26267: Add jQuery validator to memberentrygen.tt

Description Timothy Alexis Vass 2020-08-21 10:14:36 UTC

    
Comment 1 Timothy Alexis Vass 2020-08-21 10:42:13 UTC
Created attachment 108801 [details] [review]
Bug 26267: Add jQuery validator to memberentrygen.tt

To test:
1) Initiate password recovery.
2) Try to enter an invalid password.
3) Confirm that validation occurs.
4) Try to enter mismatching passwords.
5) Confirm that validation occurs.
6) Sign off.
Comment 2 Owen Leonard 2020-08-21 15:26:23 UTC
Looks good, but it's not necessary to have the $(document).ready part:

            $(document).ready(function() {
                $("#entryform").validate({

It's already inside a $(document).ready block.
Comment 3 Timothy Alexis Vass 2020-08-24 09:13:20 UTC
(In reply to Owen Leonard from comment #2)
> Looks good, but it's not necessary to have the $(document).ready part:
> 
>             $(document).ready(function() {
>                 $("#entryform").validate({
> 
> It's already inside a $(document).ready block.

Thank you for pointing it out so kindly.
Comment 4 Timothy Alexis Vass 2020-08-24 09:15:19 UTC
Created attachment 108976 [details] [review]
Bug 26267: Add jQuery validator to memberentrygen.tt

To test:
1) Add a new patron.
2) Try to enter an invalid password.
3) Confirm that validation occurs.
4) Try to enter mismatching passwords.
5) Confirm that validation occurs.
6) Sign off.
Comment 5 Owen Leonard 2020-08-24 12:21:33 UTC
Created attachment 108983 [details] [review]
Bug 26267: Add jQuery validator to memberentrygen.tt

To test:
1) Add a new patron.
2) Try to enter an invalid password.
3) Confirm that validation occurs.
4) Try to enter mismatching passwords.
5) Confirm that validation occurs.
6) Sign off.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Joonas Kylmälä 2020-08-25 15:04:03 UTC
Hi,

I don't understand what this patch does,

If I try to do steps

4) Try to enter mismatching passwords.
5) Confirm that validation occurs.

in the page /cgi-bin/koha/members/memberentry.pl I have the same result "Please enter the same password as above" with and without this patch. Is the difference somewhere else / how I confirm validation happens?
Comment 7 Timothy Alexis Vass 2020-08-25 16:37:30 UTC
I see now that in memberentrygen.tt that the validator is already included like this:
[% Asset.js("js/members.js") | $raw %]
Rather than inline, like in the other templates.