[Bug 17181] New: Patron card creator replaces existing image when uploading image with same name
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Bug ID: 17181 Summary: Patron card creator replaces existing image when uploading image with same name Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: aleishaamohia@hotmail.com QA Contact: testopia@bugs.koha-community.org If you try to upload an image into Patron Card Creator with the same file name as an image that has already been upload, the original image gets replaced, without any warning. There should be some kind of warning before replacing, i.e. "The name "filename" already exists. Upload and replace image or cancel upload?" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 --- Comment #1 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 58789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58789&action=edit Bug 17181: Check for duplicate image names when uploading image to patron card creator This patch adds a check for duplicates before uploading the image. To test: 1) Go to Tools -> Patron card creator -> Manage images 2) If you haven't already, upload an image 3) Try to upload another image with the same image name 4) Notice the first image is replaced with the second image, with no warning. 5) Apply patch and refresh page 6) Try to upload an image with the same image name again 7) Notice you are now warned about a duplicate image name. 8) Check that uploading an image with a unique name still works. Sponsored-by: Catalyst IT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Assignee|cnighswonger@foundations.ed |aleishaamohia@hotmail.com |u | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58789|0 |1 is obsolete| | --- Comment #2 from Claire Gravely <claire_gravely@hotmail.com> --- Created attachment 58808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58808&action=edit Bug 17181: Check for duplicate image names when uploading image to patron card creator This patch adds a check for duplicates before uploading the image. To test: 1) Go to Tools -> Patron card creator -> Manage images 2) If you haven't already, upload an image 3) Try to upload another image with the same image name 4) Notice the first image is replaced with the second image, with no warning. 5) Apply patch and refresh page 6) Try to upload an image with the same image name again 7) Notice you are now warned about a duplicate image name. 8) Check that uploading an image with a unique name still works. Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Comment on attachment 58808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58808 Bug 17181: Check for duplicate image names when uploading image to patron card creator Review of attachment 58808: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=17181&attachment=58808) ----------------------------------------------------------------- ::: patroncards/image-manage.pl @@ +49,5 @@
if ($op eq 'upload') { + # Checking for duplicate image name + my $duplicate; + my $dbh = C4::Context->dbh; + my $query = "SELECT image_name FROM creator_images";
What you want here is to select the number of images with the $image_name: SELECT COUNT(*) FROM creator_images WHERE image_name=? That will simplify this part of code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Aleisha Amohia <aleishaamohia@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58808|0 |1 is obsolete| | --- Comment #4 from Aleisha Amohia <aleishaamohia@hotmail.com> --- Created attachment 58888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58888&action=edit Bug 17181: Check for duplicate image names when uploading image to patron card creator This patch adds a check for duplicates before uploading the image. To test: 1) Go to Tools -> Patron card creator -> Manage images 2) If you haven't already, upload an image 3) Try to upload another image with the same image name 4) Notice the first image is replaced with the second image, with no warning. 5) Apply patch and refresh page 6) Try to upload an image with the same image name again 7) Notice you are now warned about a duplicate image name. 8) Check that uploading an image with a unique name still works. Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58888|0 |1 is obsolete| | --- Comment #5 from Claire Gravely <claire_gravely@hotmail.com> --- Created attachment 58917 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58917&action=edit Bug 17181: Check for duplicate image names when uploading image to patron card creator This patch adds a check for duplicates before uploading the image. To test: 1) Go to Tools -> Patron card creator -> Manage images 2) If you haven't already, upload an image 3) Try to upload another image with the same image name 4) Notice the first image is replaced with the second image, with no warning. 5) Apply patch and refresh page 6) Try to upload an image with the same image name again 7) Notice you are now warned about a duplicate image name. 8) Check that uploading an image with a unique name still works. Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58917|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58921 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58921&action=edit Bug 17181: Check for duplicate image names when uploading image to patron card creator This patch adds a check for duplicates before uploading the image. To test: 1) Go to Tools -> Patron card creator -> Manage images 2) If you haven't already, upload an image 3) Try to upload another image with the same image name 4) Notice the first image is replaced with the second image, with no warning. 5) Apply patch and refresh page 6) Try to upload an image with the same image name again 7) Notice you are now warned about a duplicate image name. 8) Check that uploading an image with a unique name still works. Sponsored-by: Catalyst IT Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 58922 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58922&action=edit Bug 17181: Simplify code - do not prepare statement when used only once - remove use of Data::Dumper - remove $duplicate, not needed Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Aleisha, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This won't get ported back to 16.11.x as it is an enhancement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |liz@catalyst.net.nz --- Comment #10 from Marc Véron <veron@veron.ch> --- *** Bug 15000 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 --- Comment #11 from Marc Véron <veron@veron.ch> --- (In reply to Katrin Fischer from comment #9)
This won't get ported back to 16.11.x as it is an enhancement.
Hi Katrin, can you reconsider, since users can run into a data loss by overwriting images? Marc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18800 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Liz Rea <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |REOPENED --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- These patches have been pushed to 16.11.x and will be in 16.11.10. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #13 from Mason James <mtj@kohaaloha.com> --- Pushed to 16.05.x, for 16.05.15 release -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org