Address ISBN issues in T-PAC
authorDan Scott <dan@coffeecode.net>
Tue, 16 Aug 2011 20:44:16 +0000 (16:44 -0400)
committerDan Scott <dan@coffeecode.net>
Tue, 16 Aug 2011 20:44:16 +0000 (16:44 -0400)
A few problems fixed here:

* Refer to args.isbns (plural) consistently; at times we were referring
  to args.isbn which did not exist
* Grab the textContent of the SFX ISBN node rather than the raw
  XML::LibXML Element
* Use an assignment operation when regex'ing the SFX ISBN, as the
  in-place was interpreted as a "print me" stmt and displaying the raw
  SFX ISBN.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/default/opac/parts/misc_util.tt2
Open-ILS/src/templates/default/opac/parts/result/table.tt2

index 48eea03..346b32b 100644 (file)
@@ -29,7 +29,7 @@
         args.marc_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
 
         # clean up the ISBN
-        args.isbn_clean = args.isbn.0.replace('\ .*', '');
+        args.isbn_clean = args.isbns.0.replace('\ .*', '');
 
         args.holdings = [];
         args.uris = [];
@@ -40,8 +40,8 @@
         IF sfx_isbn;
             IF sfx_isbn.textContent == "SFX";
                 my_parent = sfx_isbn.parentNode();
-                sfx_isbn = my_parent.findnodes('./*[@code="a"]');
-                sfx_isbn.replace('-', '');
+                sfx_isbn = my_parent.findnodes('./*[@code="a"]').textContent;
+                sfx_isbn = sfx_isbn.replace('-', '');
                 args.resolver_isbn = sfx_isbn.replace('\ .*', '');
             END;
         END;
index e6343d4..07fe359 100644 (file)
@@ -89,7 +89,7 @@
                                                                 <td>[% attrs.publisher; %]</td>
                                                             </tr>
                                                         [% END %]
-                                                        [% IF attrs.isbn.0 %]
+                                                        [% IF attrs.isbns.size > 0 %]
                                                             <tr name="results_isbn_tr">
                                                                 <td valign="top">
                                                                     <strong>[% l('ISBN:') %]</strong>