From 3b4ebf4126a10d36b55d200ebd228387a78ddead Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 31 Jul 2013 11:18:55 -0400 Subject: [PATCH] Bug 10628 - AutomaticItemReturn prevents holds queue from filling local holds with local items - Switch grep to any --- C4/HoldsQueue.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 7aa3f56..eff3148 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -32,6 +32,7 @@ use C4::Biblio; use C4::Dates qw/format_date/; use List::Util qw(shuffle); +use List::MoreUtils qw(any); use Data::Dumper; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -591,8 +592,7 @@ sub least_cost_branch { # If the pickup library is in the list of libraries to pull from, # return that library right away, it is obviously the least costly - my ($self) = grep( /$to/, @$from ); - return ($self) if $self; + return ($to) if any { $_ eq $to } @$from; my ($least_cost, @branch); foreach (@$from) { -- 1.7.2.5