[Koha-bugs] [Bug 17181] Patron card creator replaces existing image when uploading image with same name

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 12 13:19:45 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17181

--- Comment #3 from Jonathan Druart <jonathan.druart at 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.


More information about the Koha-bugs mailing list