Bug 11785

Summary: Use validation plugin when uploading local cover images
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ToolsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, gmcharlt, kyle
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/tools/upload-cover-image.pl
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
Bug 11785 - Use validation plugin when uploading local cover images
Bug 11785 - Use validation plugin when uploading local cover images

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