Bug 14338 - Unable to delete patron images [3.16.x]
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 5 Jun 2015 12:06:29 +0000 (08:06 -0400)
committerMason James <mtj@kohaaloha.com>
Sat, 25 Jul 2015 13:20:21 +0000 (01:20 +1200)
The call to RmPatronImage is still passing cardnumber as its parameter
instead of borrowernumber.

Test Plan:
1) Upload a patron image
2) Ensure the card number is not the same as the borrower number
3) Attempt to delete patron image
   -- Image will remain
4) Apply this patch
5) Attempt to delete patron image
   -- Image will be removed
6) run koha qa test tools

NOTE: Deletion worked in 3.16.x, though the message for
      debugging differed (cardnumber vs. borrowernumber).
      This effectively removes cardnumber from the URL and
      messages for the delete operation.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Mason James <mtj@kohaaloha.com>

koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
tools/picture-upload.pl

index f87defb..9a124ae 100644 (file)
@@ -261,7 +261,7 @@ function validate1(date) {
                 <fieldset class="action">
                     <input type="submit" value="Upload" class="submit" />
                     <input name="op" type="hidden" value="Upload" />
-                    [% IF ( picture ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;cardnumber=[% cardnumber %]&amp;borrowernumber=[% borrowernumber %]" class="delete">Delete</a>[% END %]
+                    [% IF ( picture ) %]<a id="delpicture" href="/cgi-bin/koha/tools/picture-upload.pl?op=Delete&amp;borrowernumber=[% borrowernumber %]" class="delete">Delete</a>[% END %]
                 </fieldset>
             </fieldset>
         </form>
index b2aa18a..44a715d 100755 (executable)
@@ -147,7 +147,7 @@ if ( ($op eq 'Upload') && $uploadfile ) {       # Case is important in these ope
     $template->param(filetype => $filetype);
 } elsif ( $op eq 'Delete' ) {
     my $dberror = RmPatronImage($borrowernumber);
-       $debug and warn "Patron image deleted for $cardnumber";
+    $debug and warn "Patron image deleted for $borrowernumber";
     warn "Database returned $dberror" if $dberror;
 }
 if ( $borrowernumber && !$errors && !$template->param('ERRORS') ) {