Address regression causing main headings to be null because the thesaurus code we...
authorMike Rylander <mrylander@gmail.com>
Fri, 7 Oct 2011 14:15:19 +0000 (10:15 -0400)
committerBill Erickson <berick@esilibrary.com>
Fri, 14 Oct 2011 18:21:35 +0000 (14:21 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>

Open-ILS/src/sql/Pg/011.schema.authority.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema-acs-nfi.sql

index 09bd745..4f8fc74 100644 (file)
@@ -168,7 +168,10 @@ BEGIN
           LIMIT 1;
     END IF;
 
-    IF thes_code = 'z' THEN
+    thes_code := vandelay.marc21_extract_fixed_field(marcxml,'Subj');
+    IF thes_code IS NULL THEN
+        thes_code := '|';
+    ELSIF thes_code = 'z' THEN
         thes_code := COALESCE( oils_xpath_string('//*[@tag="040"]/*[@code="f"][1]', marcxml), '' );
     END IF;
 
index 9f5762f..1e5e85a 100644 (file)
@@ -78,7 +78,10 @@ BEGIN
           LIMIT 1;
     END IF;
 
-    IF thes_code = 'z' THEN
+    thes_code := vandelay.marc21_extract_fixed_field(marcxml,'Subj');
+    IF thes_code IS NULL THEN
+        thes_code := '|';
+    ELSIF thes_code = 'z' THEN
         thes_code := COALESCE( oils_xpath_string('//*[@tag="040"]/*[@code="f"][1]', marcxml), '' );
     END IF;