X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-tiered.html;h=e76bf762b22e3cd23312ecf84dfd2cde310f8cfc;hp=e332eeff8ec9fe6bce9ed61bce25ee10bb9e26b5;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=671846c7bee35093d62a467236dddfe4706520b3 diff --git a/httemplate/elements/select-tiered.html b/httemplate/elements/select-tiered.html index e332eeff8..e76bf762b 100644 --- a/httemplate/elements/select-tiered.html +++ b/httemplate/elements/select-tiered.html @@ -124,14 +124,7 @@ 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(); +my $json = Cpanel::JSON::XS->new(); $json->canonical; my $i; @@ -181,6 +174,8 @@ for( $i = 0; $i < @$tiers; $i++ ) { $children_of{$key}->{''} = $tier->{empty_label}; } } + # ensure that there's always at least one empty label + $children_of{''}->{''} = $tier->{empty_label}; } $tier->{by_key} = \%children_of; }