From f3927140ad2c24dbd7ba8228bde0941c9734ddc8 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 f156bb4898..0501bc2021 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -881,9 +881,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