Bug 11785 - Use validation plugin when uploading local cover images
Summary: Use validation plugin when uploading local cover images
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/tools/upload-cover-imag...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 17:13 UTC by Owen Leonard
Modified: 2015-06-04 23:30 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 11785 - Use validation plugin when uploading local cover images (2.48 KB, patch)
2014-02-18 17:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 11785 - Use validation plugin when uploading local cover images (2.50 KB, patch)
2014-02-18 23:43 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 11785 - Use validation plugin when uploading local cover images (2.56 KB, patch)
2014-02-20 09:47 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 2014-02-18 17:13:13 UTC
The upload local cover images form uses broken custom validation JavaScript which can be fixed by replacing it with HTML5 validation attributes in conjunction with Koha's built-in validation plugin (http://jqueryvalidation.org/documentation/).
Comment 1 Owen Leonard 2014-02-18 17:21:43 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2014-02-18 23:43:12 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-02-20 09:47:32 UTC
Created attachment 25480 [details] [review]
Bug 11785 - Use validation plugin when uploading local cover images

When uploading local cover images the form should not be submitted if
no file has been selected. The existing form validation script doesn't
work. This patch adds HTML5 validation attributes and use of Koha's
built-in form validation plugin.

To test, apply the patch and go to Tools -> Upload local cover image.
Try to submit the form without selecting a file to upload. You should be
prevented from doing so. Choose a file and confirm that the upload
completes correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 4 Galen Charlton 2014-02-20 17:07:32 UTC
Pushed to master.  Thanks, Owen!
Comment 5 Fridolin Somers 2014-05-21 07:46:40 UTC
Pushed to 3.14.x, will be in 3.14.07
Comment 6 Kyle M Hall 2014-06-06 13:53:31 UTC
Pushed to 3.12.x will be in 3.12.13