Bug 11789 - Use validation plugin when creating new list
Summary: Use validation plugin when creating new list
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/virtualshelves/shelves....
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 20:37 UTC by Owen Leonard
Modified: 2014-12-07 20:05 UTC (History)
4 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 11789 - Use validation plugin when creating new list (5.48 KB, patch)
2014-02-18 20:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 11789 - Use validation plugin when creating new list (5.49 KB, patch)
2014-02-19 00:47 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11789 - Use validation plugin when creating new list (5.55 KB, patch)
2014-02-20 10:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 11789 - Use validation plugin when creating new list (5.53 KB, patch)
2014-02-20 19:39 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 Owen Leonard 2014-02-18 20:37:21 UTC
The new list entry form uses custom validation JavaScript which can be easily replaced with HTML5 validation attributes in conjunction with Koha's built-in validation plugin (http://jqueryvalidation.org/documentation/).
Comment 1 Owen Leonard 2014-02-18 20:43:45 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-02-19 00:47:49 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-02-19 08:59:51 UTC
Comment on attachment 25408 [details] [review]
Bug 11789 - Use validation plugin when creating new list

Review of attachment 25408 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ +430,3 @@
>          <ol>
> +        <li><label class="required" for="addshelf">List name:</label><input id="addshelf" type="text" name="addshelf" size="25" required="required" class="required" />
> +            <span class="required">Required</span>

Are you sure this "required" string is useful? The label is already in red.
I just passed QA on bug 11766 and bug 11767 and you didn't add it.
Should we be consistent for all forms?
Comment 4 Jonathan Druart 2014-02-20 10:05:51 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-02-20 10:07:39 UTC
(In reply to Jonathan Druart from comment #3)
> Are you sure this "required" string is useful? The label is already in red.
> I just passed QA on bug 11766 and bug 11767 and you didn't add it.
> Should we be consistent for all forms?

Owen's answer (IRC): I am trying to consistently add the "Required" note, and I realize I missed it on some of my recent patches. I think it's useful. Not everyone is going to know what the red color indicates.
Comment 6 Galen Charlton 2014-02-20 17:09:18 UTC
This patch no longer applies.
Comment 7 Owen Leonard 2014-02-20 19:39:06 UTC
Created attachment 25520 [details] [review]
Bug 11789 - Use validation plugin when creating new list

The page for adding a new list includes some custom form validation
JavaScript which can be removed in favor of HTML5 validation attributes
and Koha's built-in validation plugin. This patch does so.

Other edits: Minor validation fixes.

To test, apply the patch and go to Lists -> New list. Try submitting the
form without entering a list name. This should trigger a validation
warning.

Submission of the form with valid data should work correctly. Editing an
existing list should also work correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Galen Charlton 2014-02-21 20:15:01 UTC
Pushed to master.  Thanks, Owen!
Comment 9 Fridolin Somers 2014-05-21 09:08:40 UTC
Pushed to 3.14.x, will be in 3.14.07