From 4d5721835972e1c1be9e606f3a982486e639802b 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 3e52959ecd..d4b09eb5c1 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 fe789c598a..285fd59607 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -300,7 +300,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