Clear-shelf includes pickup-lib changes : Perl repairs
authorBill Erickson <berick@esilibrary.com>
Wed, 22 Aug 2012 14:00:11 +0000 (10:00 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 22 Aug 2012 14:00:11 +0000 (10:00 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 3d689ce..86d0cc5 100644 (file)
@@ -3461,7 +3461,7 @@ sub clear_shelf_process {
             # the clear-shelf cache.  But, only add them to the pl_changed 
             # list if they are not otherwise getting canceled by this process.
             pl_changed => 1 ? # TODO ORG SETTING
-                pickup_lib_changed_on_shelf_holds($e, $org_id, @hold_ids) : []
+                pickup_lib_changed_on_shelf_holds($e, $org_id, \@hold_ids) : []
         );
 
         for my $hold (@holds) {
@@ -3516,6 +3516,7 @@ sub pickup_lib_changed_on_shelf_holds {
     my $e = shift;
     my $org_id = shift;
     my $ignore_holds = shift;
+    $ignore_holds = [$ignore_holds] if !ref($ignore_holds);
 
     my $query = {
         select => { alhr => ['id'] },
@@ -3538,7 +3539,8 @@ sub pickup_lib_changed_on_shelf_holds {
         }
     };
 
-    $query->{where}->{'+alhr'}->{id} = {'!=' => $ignore_holds} if $ignore_holds;
+    $query->{where}->{'+alhr'}->{id} =
+        {'not in' => $ignore_holds} if @$ignore_holds;
 
     my $hold_ids = $e->json_query($query);
     return map { $_->{id} } @$hold_ids;