[OPEN-ILS-DEV] PATCH: Z39.50 import broken due to marc_view.html issues

Jeff Godin jeff at tcnet.org
Thu Apr 2 09:10:07 EDT 2009


Greetings-

Running 1.4.0.4, attempting an "Import Record from Z39.50" in the staff
client results in: ReferenceError: my_init is not defined. The error is
thrown by marc_view.html

As of changeset 12600 [1], .html files in /xul/ are being processed by the
XMLENT filter and having their comments stripped. The contents of the
<script> on that page were wrapped in an HTML comment, so the entire scrip
was being removed.

I did some looking for other files that may have been impacted in a
similar way, but did not find any last night.

I removed the comment tags and wrapped the script contents in <![CDATA[
]]> so that it could be parsed by XMLENT. Added/tweaked some type
attributes as well and escaped a closing tag. Patch against trunk is
attached. If the patch is acceptable, please apply to the 1.4 branches
also.

Thanks!

-jeff

[1]: http://svn.open-ils.org/trac/ILS/changeset/12600#file0
-------------- next part --------------
Index: Open-ILS/xul/staff_client/server/cat/marc_view.html
===================================================================
--- Open-ILS/xul/staff_client/server/cat/marc_view.html	(revision 12762)
+++ Open-ILS/xul/staff_client/server/cat/marc_view.html	(working copy)
@@ -1,11 +1,11 @@
 <html>
 <head>
-<style>
+<style type='text/css'>
 .marc_subfield_code { color: blue; padding-left: 5px; padding-right: 5px }
 </style>
-<script src="/xul/server/main/constants.js"></script>
-<script>
-<!--
+<script type='text/javascript' src='/xul/server/main/constants.js'></script>
+<script type='text/javascript'>
+<![CDATA[
 
 	var xsltProcessor;
 
@@ -45,12 +45,12 @@
 
 	function my_init() {
 		if (!xsl_marc2html_init()) return;
-		document.body.innerHTML = "<button onclick='window.print()'>Print Page</button>";
+		document.body.innerHTML = "<button onclick='window.print()'>Print Page<\/button>";
 		if (typeof xulG != 'undefined' && xulG.marcxml) apply_xsl_marc2html(xulG.marcxml);
 		document.body.firstChild.focus();
 	}
 
--->
+]]>
 </script>
 </head>
 <body onload="try { my_init(); } catch(E) { alert(E); }">


More information about the Open-ils-dev mailing list