LP#1734963: Teach copy template converter about older templates.
authorChris Sharp <csharp@georgialibraries.org>
Tue, 28 Nov 2017 18:42:26 +0000 (13:42 -0500)
committerJeff Godin <jgodin@tadl.org>
Wed, 29 Nov 2017 16:58:51 +0000 (11:58 -0500)
The XUL-to-web-client copy template converter created to fix
bug 1691269 needs a little help when the value stored is a
number rather than a string.

Thanks to Jeff Godin for troubleshooting help and Mike
Rylander for the suggested solution.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Jeff Godin <jgodin@tadl.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index a87ea1e..7fe8ddd 100644 (file)
@@ -334,7 +334,7 @@ function(egCore , $q) {
                             stat_cats[field_name] = parseInt(curr_field["value"]);
                         } else {
                             tmp_val = curr_field['value']; // so... some of the number fields are actually strings. Groovy.
-                            if ( tmp_val.match(/^[-0-9.]+$/) && !(field_name.match(/(?:loan_duration|fine_level)/))) {
+                            if ( tmp_val.toString().match(/^[-0-9.]+$/) && !(field_name.match(/(?:loan_duration|fine_level)/))) {
                                 tmp_val = parseFloat(tmp_val);
                             }