From 4c8c8473d929f2c8c0aa21887a68ee0a617a6a01 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'. Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- 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 777bde3d48..61873656b3 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -899,9 +899,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 f891858912..58a5e8462b 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -297,7 +297,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