[open-ils-commits] r13599 - trunk/Open-ILS/src/perlmods/OpenILS/Application (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jul 15 12:12:58 EDT 2009
Author: miker
Date: 2009-07-15 12:12:55 -0400 (Wed, 15 Jul 2009)
New Revision: 13599
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Log:
Protect against duplicate Located URIs at ingest time
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2009-07-15 15:20:51 UTC (rev 13598)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2009-07-15 16:12:55 UTC (rev 13599)
@@ -175,11 +175,19 @@
}
}
+ # Check for an existing CN-URI map
+ $tmp = $cstore->request(
+ 'open-ils.cstore.direct.asset.uri_call_number_map.id_list',
+ { call_number => $u->{call_number}->id, uri => $u->{uri}->id }
+ )->gather(1);
+
+ next if ($tmp);
+
my $umap = Fieldmapper::asset::uri_call_number_map->new;
$umap->uri($u->{uri}->id);
$umap->call_number($u->{call_number}->id);
- $cstore->request( 'open-ils.cstore.direct.asset.uri_call_number_map.create' => $umap )->gather(1) if (!$tmp);
+ $cstore->request( 'open-ils.cstore.direct.asset.uri_call_number_map.create' => $umap )->gather(1);
}
# update full_rec stuff ...
More information about the open-ils-commits
mailing list