Bug 26267 - Add jQuery validator to memberentrygen.tt
Summary: Add jQuery validator to memberentrygen.tt
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Timothy Alexis Vass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-21 10:14 UTC by Timothy Alexis Vass
Modified: 2022-06-06 20:25 UTC (History)
3 users (show)

See Also:
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 (1.65 KB, patch)
2020-08-21 10:42 UTC, Timothy Alexis Vass
Details | Diff | Splinter Review
Bug 26267: Add jQuery validator to memberentrygen.tt (1.53 KB, patch)
2020-08-24 09:15 UTC, Timothy Alexis Vass
Details | Diff | Splinter Review
Bug 26267: Add jQuery validator to memberentrygen.tt (1.59 KB, patch)
2020-08-24 12:21 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.