From 2315c14ced7f7f44940bb8924aebb3ebb2bf1227 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Mon, 12 Nov 2018 09:17:11 -0500 Subject: [PATCH] LP 1779467: Fix Error When Marking Item on Hold as Discard/Weed Fix the following error when marking an on-hold item as Discard/Weed: Can't use an undefined value as an ARRAY reference at /usr/local/share/perl/5.18.2/OpenILS/Application/Circ.pm line 1393. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier LP#1779467: Fix 'Dicard' typo Signed-off-by: Kathy Lussier Signed-off-by: Jason Stephenson Signed-off-by: Terran McCanna Signed-off-by: Chris Sharp --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm | 6 +++--- Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index f3cec222d0..0dfebd3bf6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -1376,21 +1376,21 @@ sub mark_item { return $evt if $evt; # Retrieving holds for later use. - my $holds = $e->search_action_hold_request( + my $holds = $e->search_action_hold_request([ { current_copy => $copy->id, fulfillment_time => undef, cancel_time => undef, }, {flesh=>1, flesh_fields=>{ahr=>['eligible_copies']}} - ); + ]); # Throw event if attempting to mark discard the only copy to fill a hold. if ($self->api_name =~ /discard/) { if (!$args->{handle_last_hold_copy}) { for my $hold (@$holds) { my $eligible = $hold->eligible_copies(); - if (scalar(@{$eligible}) < 2) { + if (!defined($eligible) || scalar(@{$eligible}) < 2) { $evt = OpenILS::Event->new('ITEM_TO_MARK_LAST_HOLD_COPY'); last; } diff --git a/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 b/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 index e5b1e1bce8..5e40fb520d 100644 --- a/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 +++ b/Open-ILS/src/templates/staff/circ/share/circ_strings.tt2 @@ -27,7 +27,7 @@ s.LOCATION_ALERT_MSG = "{{copy.barcode()}}","{{copy.location().name()}}") %]'; s.MARK_DAMAGED_CONFIRM = '[% l("Mark {{num_items}} items as DAMAGED?") %]'; s.MARK_MISSING_CONFIRM = '[% l("Mark {{num_items}} items as MISSING?") %]'; -s.MARK_DISCARD_CONFIRM = '[% l("Mark {{num_items}} items as DICARD/WEED?") %]'; +s.MARK_DISCARD_CONFIRM = '[% l("Mark {{num_items}} items as DISCARD/WEED?") %]'; s.MARK_ITEM_CHECKED_OUT = '[% l("Item {{barcode}} is checked out.") %]'; s.MARK_ITEM_IN_TRANSIT = '[% l("Item {{barcode}} is in transit.") %]'; s.MARK_ITEM_RESTRICT_DELETE = '[% l("Item {{barcode}} is in a status with a copy delete warning.") %]'; -- 2.43.2