Bug 17879

Summary: Possible to upload images with no image name
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: Label/patron card printingAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: julian.maurice, katrin.fischer, kyle, mtj
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 17879: Use image filename if no image name is entered
Bug 17879: Use image filename if no image name is entered
Bug 17879: Use image filename if no image name is entered

Description Aleisha Amohia 2017-01-10 22:20:31 UTC
This is a problem because the image name is used in the patron card layout editor, and if a person uploads a bunch of images with no names then it will be difficult to tell which image is which.
Comment 1 Aleisha Amohia 2017-01-10 22:23:33 UTC
Created attachment 58788 [details] [review]
Bug 17879: Use image filename if no image name is entered

This patch changes the code to use the filename of the uploaded image if
no specific image name is entered.

To test:
1) Go to Tools -> Patron card creator -> Manage images
2) Upload an image and leave the image name field empty
3) Notice this works and 'Name' is left empty.
4) Apply patch and refresh page
5) Upload an image and leave the image name field empty
6) Notice the image name is given the filename so that 'Name' is no
longer empty.

Sponsored-by: Catalyst IT
Comment 2 Claire Gravely 2017-01-11 07:51:46 UTC
Created attachment 58795 [details] [review]
Bug 17879: Use image filename if no image name is entered

This patch changes the code to use the filename of the uploaded image if
no specific image name is entered.

To test:
1) Go to Tools -> Patron card creator -> Manage images
2) Upload an image and leave the image name field empty
3) Notice this works and 'Name' is left empty.
4) Apply patch and refresh page
5) Upload an image and leave the image name field empty
6) Notice the image name is given the filename so that 'Name' is no
longer empty.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Comment 3 Jonathan Druart 2017-01-11 08:59:08 UTC
Created attachment 58798 [details] [review]
Bug 17879: Use image filename if no image name is entered

This patch changes the code to use the filename of the uploaded image if
no specific image name is entered.

To test:
1) Go to Tools -> Patron card creator -> Manage images
2) Upload an image and leave the image name field empty
3) Notice this works and 'Name' is left empty.
4) Apply patch and refresh page
5) Upload an image and leave the image name field empty
6) Notice the image name is given the filename so that 'Name' is no
longer empty.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Kyle M Hall 2017-01-13 11:45:32 UTC
Pushed to master for 17.05, thanks Aleisha!
Comment 5 Katrin Fischer 2017-01-15 17:49:43 UTC
Reclassifying this to be a bug - 
This patch has been pushed to 16.11.x and will be in 16.11.02.
Comment 6 Julian Maurice 2017-01-19 15:09:21 UTC
Pushed to 3.22.x for 3.22.15
Comment 7 Mason James 2017-01-27 03:05:00 UTC
Pushed to 16.05.x, for 16.05.08 release