Bug 16299 - Use validation plugin when creating a patron attribute type
Summary: Use validation plugin when creating a patron attribute type
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/admin/patron-attr-types.pl
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 17:38 UTC by Owen Leonard
Modified: 2016-12-05 21:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16299 - Use validation plugin when creating a patron attribute type (4.91 KB, patch)
2016-04-19 18:07 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16299 - Use validation plugin when creating a patron attribute type (5.00 KB, patch)
2016-04-21 12:20 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16299 - Use validation plugin when creating a patron attribute type (5.07 KB, patch)
2016-04-23 06:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-04-19 17:38:45 UTC
The patron attribute types entry form uses custom JS to perform basic validation. This can be handled more easily by the validation plugin.
Comment 1 Owen Leonard 2016-04-19 18:07:13 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-04-21 12:20:11 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-04-23 06:54:12 UTC
Created attachment 50596 [details] [review]
Bug 16299 - Use validation plugin when creating a patron attribute type

This patch replaces custom client-side form validation with use of the
jQuery validation plugin. Besides reducing the amount of code in the
template, this allows us to eliminate use of "onclick."

This patch also makes a correction for HTML validity: <option value=""
/> is not accepted. I have also added an id attribute to a <select>
which lacked it.

To test, apply the patch and go to Administration -> Patron attribute
types.

- Test creating a new patron attribute type. Try to submit the form
  without a code, description, or both. You should be prevented from
  doing so.
- Test editing an existing patron attribute type. You should not be able
  to remove the description and have it save successfully.

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Kyle M Hall 2016-04-29 15:41:04 UTC
Pushed to master for the 16.05 release! Thanks Owen!