backporting TCN duplicate detection fix from head
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Apr 2009 23:51:12 +0000 (23:51 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Apr 2009 23:51:12 +0000 (23:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4_0@12954 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/import/marc2bre.pl

index 7b90dab..60af1e9 100755 (executable)
@@ -361,12 +361,6 @@ sub preprocess {
                }
     }
 
-    if (!$tcn_value || exists $used_tcns{$tcn_value}) {
-               $tcn_source = 's';
-               $tcn_number = $id;
-               $tcn_value = $tcn_source.$tcn_number;
-    }
-
        # special case to catch possibly passed in full OCLC numbers and those derived from the 001 field
        if ($tcn_value =~ /^oc(m|n)(\d+)$/o) {
                $tcn_source = 'o';
@@ -374,6 +368,13 @@ sub preprocess {
                $tcn_value = $tcn_source.$tcn_number;
        }
 
+    if (!$tcn_value || exists $used_tcns{$tcn_value}) {
+               $tcn_source = 's';
+               $tcn_number = $id;
+               $tcn_value = $tcn_source.$tcn_number;
+        $warn = 1;
+    }
+
        # expand $tcn_source from code letter to full name
        $tcn_source = do { $tcn_source_map{$tcn_source} || 'Unknown' };