Bug 30859

Summary: Upgrade jQuery Validation plugin from v1.19.1
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aude.charillon, david, dcook, lucas
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
22.11.00
Circulation function:
Bug Depends on:    
Bug Blocks: 34623    
Attachments: Bug 30859: Upgrade jQuery Validation plugin from v1.19.1
Bug 30859: Upgrade jQuery Validation plugin from v1.19.1
Bug 30859: Upgrade jQuery Validation plugin from v1.19.1

Description Owen Leonard 2022-05-27 11:31:32 UTC
Koha currently uses v1.19.1 of the jQuery Validation plugin which was released in 2019. We should upgrade to the latest version, which at the time I'm filing the bug is 1.19.4. Updates to the plugin have been made to improve compatibility with the latest version of jQuery.
Comment 1 Owen Leonard 2022-05-27 13:13:03 UTC
Created attachment 135420 [details] [review]
Bug 30859: Upgrade jQuery Validation plugin from v1.19.1

This patch updates the jQuery Validation plugin in both the OPAC and
staff interface. This upgrade brings the plugin to the current latest
version (1.19.4) which includes compatibility fixes for the latest
version of jQuery.

To test, apply the patch and test various forms in the OPAC and staff
interface to confirm that validation is still working correctly.

In the OPAC:

- Patron self-registration: Required fields, password match
  and complexity. Test also the "Forgot password" and "Change password"
  interfaces.

In the staff interface, for example:

- Patrons -> Patron password change: Required fields, password match and
  complexity.
- Administration -> Patron categories -> New category:
  - Required fields
  - One or the other enrollment period inputs
  - Digits required in password expiration, age required, upper age
    limit
  - Numbers required in enrollment and hold fee.
- Administration -> Budgets -> New budget:
  - Required fields
  - End date must be after start date
- Administration -> Cities & towns: Required fields
Comment 2 David Nind 2022-05-29 20:00:01 UTC
Created attachment 135443 [details] [review]
Bug 30859: Upgrade jQuery Validation plugin from v1.19.1

This patch updates the jQuery Validation plugin in both the OPAC and
staff interface. This upgrade brings the plugin to the current latest
version (1.19.4) which includes compatibility fixes for the latest
version of jQuery.

To test, apply the patch and test various forms in the OPAC and staff
interface to confirm that validation is still working correctly.

In the OPAC:

- Patron self-registration: Required fields, password match
  and complexity. Test also the "Forgot password" and "Change password"
  interfaces.

In the staff interface, for example:

- Patrons -> Patron password change: Required fields, password match and
  complexity.
- Administration -> Patron categories -> New category:
  - Required fields
  - One or the other enrollment period inputs
  - Digits required in password expiration, age required, upper age
    limit
  - Numbers required in enrollment and hold fee.
- Administration -> Budgets -> New budget:
  - Required fields
  - End date must be after start date
- Administration -> Cities & towns: Required fields

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-05-29 20:24:35 UTC
I've signed off, but noted these things - these are the same behaviour as in current master:

- New patron category: password expiration field is not validated - can enter anything, if not valid is blank on edit (have logged as bug 30864).

- Patron changing their password from their account (change your password): this form (as well as the forgotten password form) work "differently", with any error messages shown in a text block above the form instead of highlight errors in red. This is the current behaviour, and things validate as expected.

Other testing notes (koha-testing-docker): to enable forgotten password recovery, the system preference is OpacResetPassword.
Comment 4 Jonathan Druart 2022-06-16 13:19:12 UTC
Created attachment 136162 [details] [review]
Bug 30859: Upgrade jQuery Validation plugin from v1.19.1

This patch updates the jQuery Validation plugin in both the OPAC and
staff interface. This upgrade brings the plugin to the current latest
version (1.19.4) which includes compatibility fixes for the latest
version of jQuery.

To test, apply the patch and test various forms in the OPAC and staff
interface to confirm that validation is still working correctly.

In the OPAC:

- Patron self-registration: Required fields, password match
  and complexity. Test also the "Forgot password" and "Change password"
  interfaces.

In the staff interface, for example:

- Patrons -> Patron password change: Required fields, password match and
  complexity.
- Administration -> Patron categories -> New category:
  - Required fields
  - One or the other enrollment period inputs
  - Digits required in password expiration, age required, upper age
    limit
  - Numbers required in enrollment and hold fee.
- Administration -> Budgets -> New budget:
  - Required fields
  - End date must be after start date
- Administration -> Cities & towns: Required fields

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Tomás Cohen Arazi (tcohen) 2022-07-01 19:43:33 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass (lukeg) 2022-08-09 22:01:41 UTC
Enhancement will not be backported to 22.05.x series unless requested
Comment 7 Aude Charillon 2023-01-05 14:18:56 UTC
No update to Koha manual needed.