Bug 25261: (QA follow-up) Prevent server error on bad barcode
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 17 Sep 2020 14:01:32 +0000 (15:01 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 1 Oct 2020 08:33:10 +0000 (10:33 +0200)
Prior to this patch if you had CircConfirmParts enabled and you
attempted to checkin a deleted item then you would be met with a server
error.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
circ/returns.pl

index fab9976..7a45995 100755 (executable)
@@ -297,9 +297,11 @@ if ($barcode) {
     # Block return if multi-part and confirm has not been received
     my $needs_confirm =
          C4::Context->preference("CircConfirmItemParts")
+      && $item
       && $item->materials
       && !$query->param('multiple_confirm');
-    $template->param('multiple_confirmed' => 1) if $query->param('multiple_confirm');
+    $template->param( 'multiple_confirmed' => 1 )
+      if $query->param('multiple_confirm');
 
     # do the return
     ( $returned, $messages, $issue, $borrower ) =