[freeside-commits] branch FREESIDE_2_3_BRANCH updated. d18a2d8fcf7dcfcc55ace0461902fa6f1c36228b

Ivan ivan at 420.am
Thu Oct 11 15:17:04 PDT 2012


The branch, FREESIDE_2_3_BRANCH has been updated
       via  d18a2d8fcf7dcfcc55ace0461902fa6f1c36228b (commit)
       via  b7d5d55cc3cd3fa3437b6ca239768df937605b2b (commit)
      from  920fcb0f612e3ef64064989d5fb20828f3297218 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d18a2d8fcf7dcfcc55ace0461902fa6f1c36228b
Merge: b7d5d55 920fcb0
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Oct 11 15:17:00 2012 -0700

    Merge branch 'FREESIDE_2_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_2_3_BRANCH


commit b7d5d55cc3cd3fa3437b6ca239768df937605b2b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Oct 11 15:16:45 2012 -0700

    backport broadband provision sort order (and JSON loading) fixes to 2.3, RT#19762

diff --git a/httemplate/elements/select-tiered.html b/httemplate/elements/select-tiered.html
index 99b2852..e332eef 100644
--- a/httemplate/elements/select-tiered.html
+++ b/httemplate/elements/select-tiered.html
@@ -59,7 +59,11 @@ main argument list, and will be applied to the last tier.
   >
 %   if ( $i == 0 ) {
 %     my $options = $tiers_by_key->[0]->{''};
-%     foreach ( sort keys %$options ) {
+%     #foreach ( sort keys %$options ) {
+%     foreach ( sort { lc($options->{$a}) cmp lc($options->{$b}) }
+%                 keys %$options
+%             )
+%     {
   <OPTION VALUE="<%$_ |h%>" <% $curr_values->[$i] eq $_ ? 'SELECTED' : ''%>>
   <% $options->{$_} |h%></OPTION>
 %     }
@@ -68,8 +72,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 +124,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];

-----------------------------------------------------------------------

Summary of changes:
 httemplate/elements/select-tiered.html |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list