RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / elements / select-tiered.html
index 3ff5471..e76bf76 100644 (file)
@@ -124,7 +124,7 @@ my %opt = @_;
 my $pre = $opt{prefix} || '';
 my $tiers = $opt{tiers} or die "no tiers defined";
 
-my $json = JSON::XS->new();
+my $json = Cpanel::JSON::XS->new();
 $json->canonical;
 
 my $i;
@@ -174,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;
 }