summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-tiered.html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-10-05 18:01:40 -0700
committerIvan Kohler <ivan@freeside.biz>2012-10-05 18:01:40 -0700
commit490a84555bf376fdee7a8be49f1658c906913d78 (patch)
treeaf88ad7314857d052d8dadae1f905899e1ba2573 /httemplate/elements/select-tiered.html
parent0af38652da3b3be7da2d35b048285ef6f2194e1a (diff)
work around wacky JSON autoload problem, fallout from #16266 plus probably a JSON vs Mason bug?
Diffstat (limited to 'httemplate/elements/select-tiered.html')
-rw-r--r--httemplate/elements/select-tiered.html12
1 files changed, 11 insertions, 1 deletions
diff --git a/httemplate/elements/select-tiered.html b/httemplate/elements/select-tiered.html
index 99b285274..7a7982e56 100644
--- a/httemplate/elements/select-tiered.html
+++ b/httemplate/elements/select-tiered.html
@@ -68,8 +68,8 @@ main argument list, and will be applied to the last tier.
</SELECT>
<% $tier->{after} %>
% } #foreach $tier
+
<SCRIPT type="text/javascript">
-% my $json = JSON->new->canonical; #sort
var <% $pre %>tiers = <% $json->encode($tiers_by_key) %>;
var <% $pre %>curr_values = <% $json->encode($curr_values) %>;
function <% $pre %>select_change(select_this, i) {
@@ -120,6 +120,16 @@ my %opt = @_;
my $pre = $opt{prefix} || '';
my $tiers = $opt{tiers} or die "no tiers defined";
+#my $json = JSON->new()->canonical(); #sort
+# something super weird and broken going on with JSON's auto-loading, just
+# using JSON alone errors out with
+# Can't locate object method "new" via package "null" (perhaps you forgot to
+# load "null"?)
+# yes, "null", not "JSON". so instead, using JSON::XS explicity...
+use JSON::XS;
+my $json = JSON::XS->new();
+$json->canonical;
+
my $i;
for( $i = 0; $i < @$tiers; $i++ ) {
my $tier = $tiers->[$i];