Flexible TCN match configuration
authorberick <berick@esilibrary.com>
Thu, 19 May 2011 19:40:30 +0000 (15:40 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:53 +0000 (14:50 -0400)
If users do not want records with duplicate TCN values imported, users
should rely on match-sets to enforce this policy instead of a hard-coded
duplicate tcn block.  This is done by automatically calling the 'override'
version of bib XML import.  The only tcn-related failure that can now
occur is if no free, non-dupe TCN value can be extracted from the record.

Open-ILS/src/perlmods/lib/OpenILS/Application/Vandelay.pm

index 65a0013..0647c88 100644 (file)
@@ -1089,14 +1089,16 @@ sub import_record_list_impl {
             
                 $logger->info("vl: creating new $type record for queued record $rec_id");
                 if($type eq 'bib') {
-                    $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import($e, $rec->marc, $bib_sources{$rec->bib_source});
+                    $record = OpenILS::Application::Cat::BibCommon->biblio_record_xml_import(
+                        $e, $rec->marc, $bib_sources{$rec->bib_source}, undef, 1);
                 } else {
 
                     $record = OpenILS::Application::Cat::AuthCommon->import_authority_record($e, $rec->marc); #$source);
                 }
 
                 if($U->event_code($record)) {
-                    $$report_args{import_error} = 'import.duplicate.tcn' if $record->{textcode} eq 'TCN_EXISTS';
+                    $$report_args{import_error} = 'import.duplicate.tcn' 
+                        if $record->{textcode} eq 'OPEN_TCN_NOT_FOUND';
                     $$report_args{evt} = $record;
 
                 } else {