ACQ avoid dupe lineitem asset processing / patron reqs user/berick/acq-avoid-dupe-li-asset-create user/berick/lp1269865-acq-avoid-dupe-hold-reqs
authorBill Erickson <berick@esilibrary.com>
Thu, 16 Jan 2014 15:30:56 +0000 (10:30 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 16 Jan 2014 15:30:56 +0000 (10:30 -0500)
Repair a thinko in create_lineitem_list_assets which resulted in each
lineitem havings its asset creation routine run twice.  In addition to
making the code more efficient, this will avoid the unintended creation
of duplicate holds from ACQ user requests.

Note that copies and call numbers were not duplicated, because the code
was already preventing that.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Order.pm

index eac934b..7bd21c4 100644 (file)
@@ -423,7 +423,10 @@ sub import_li_bibs_via_vandelay {
     );
 
     # add the already-imported records to the response list
-    push(@{$res->{li_ids}}, grep { $_ != @$needs_importing } @$li_ids);
+    for my $id (@$li_ids) {                                                        
+        push(@{$res->{li_ids}}, $id)                                               
+            unless grep { $_ == $id } @$needs_importing;                           
+    }
 
     $logger->info("acq-vl: processing recs via Vandelay with args: ".Dumper($vandelay));