deduplicate bibs going into the merge queue
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Oct 2010 00:27:46 +0000 (00:27 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 13 Oct 2010 00:27:46 +0000 (00:27 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18298 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/TemplateBatchBibUpdate.pm

index b48bfe8..aafaf45 100644 (file)
@@ -157,9 +157,12 @@ sub handler {
 
     $e->request('open-ils.cstore.direct.container.biblio_record_entry_bucket_item.create', $item )->gather(1);
 
+    my %seen;
     for my $r (@records) {
+        next unless ($seen{$r})
         $item->target_biblio_record_entry($r);
         $e->request('open-ils.cstore.direct.container.biblio_record_entry_bucket_item.create', $item )->gather(1);
+        $seen{$r}++;
     }
 
     $e->request('open-ils.cstore.transaction.commit')->gather(1);