Receipt editor and %bill_id% collab/phasefx/payment_template_preview_fix_rel_2_1
authorJason Etheridge <jason@esilibrary.com>
Mon, 19 Dec 2011 20:30:06 +0000 (15:30 -0500)
committerJason Etheridge <jason@esilibrary.com>
Mon, 19 Dec 2011 20:30:06 +0000 (15:30 -0500)
This fixes pop-up errors when viewing the bill_payment template in rel_2_1.
We're trying to call .replace on a number instead of a string with the sample
data provided.  I think this should be forward-ported to master as defensive
code.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/print.js

index d11602d..dc63a48 100644 (file)
@@ -97,7 +97,7 @@ util.print.prototype = {
 
     'escape_html' : function(data) {
         if (typeof data == 'object') { return ''; }
-        return data.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+        return String(data).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
     },
 
     'simple' : function(msg,params) {