Lp 1779319: Add ISBN subfield q to OPAC display.
authorJason Stephenson <jason@sigio.com>
Fri, 29 Jun 2018 15:36:30 +0000 (11:36 -0400)
committerRogan Hamby <rogan.hamby@gmail.com>
Thu, 1 Aug 2019 14:44:39 +0000 (10:44 -0400)
Many new MARC records come with the format and extra information in
the 020 subfield q instead of tacked on the end of the subfield a.
This patch appends the content of the subfield q to the ISBN output in
misc_util.tt2.

To test, first find a record with a 020 subfield q and look it up in
the OPAC or staff client.  Note that the subfield q information does
not display after the ISBN.  Apply this patch and look the record up
again.  Now, the subfield q should display after the ISBN.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 6f3d18b..431db99 100644 (file)
 
         args.isbns = [];
         FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]');
-            args.isbns.push(isbn.textContent);
+            text = isbn.textContent;
+            FOR q IN isbn.findnodes('../*[@code="q"]');
+                text = text _ ' ' _ q.textContent;
+                LAST; # Should only be 1, but just makin' sure.
+            END;
+            args.isbns.push(text);
         END;
 
         # UPCs can be identified either by ind1="1" or subfield 2 of "upc"