From 41b89414c124a97c07b340391db11dfcb9ddcf8b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 6 May 2020 09:25:37 +0100 Subject: [PATCH] Bug 25261: (follow-up) item.material may contain non-numerics Whilst QAing bug 13547 it was highlighted to me the at the 952$3 field, and thus the item.materials field, may contain arbitrary notes about the material rather than just numeric values. As such we need to check for the field being defined as aposed to greater than '0'. --- C4/Circulation.pm | 5 ++--- circ/returns.pl | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index a0054658f1..5f6e3b9cbd 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -845,9 +845,8 @@ sub CanBookBeIssued { # Additional Materials Check if ( C4::Context->preference("CircConfirmItemParts") ) { - my $no_of_parts = $item_object->materials || 0; - if ( $no_of_parts > 0 ) { - $needsconfirmation{additional_materials} = $no_of_parts; + if ( $item_object->materials ) { + $needsconfirmation{additional_materials} = $item_object->materials; } } diff --git a/circ/returns.pl b/circ/returns.pl index 204d624fdd..7c7db6b166 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -298,7 +298,7 @@ if ($barcode) { # Block return if multi-part and confirm has not been received my $needs_confirm = 0; if ( C4::Context->preference("CircConfirmItemParts") ) { - if ( $item->materials > 0 && !$query->param('multiple_confirm') ) { + if ( $item->materials && !$query->param('multiple_confirm') ) { $needs_confirm = 1; } } -- 2.20.1