From 04bf3e2423b070d3e3e2a2e6006b678bcf11b481 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 17 Apr 2013 20:44:39 -0700 Subject: [PATCH] move from legacy compat JSON to_json to modern JSON::XS encode_json, RT#22630 --- FS/FS/Mason.pm | 2 +- FS/FS/UI/Web.pm | 7 ++----- httemplate/edit/payment_gateway.html | 2 +- httemplate/elements/auto-table.html | 4 ++-- httemplate/elements/dashboard-toplist.html | 3 --- httemplate/elements/select-tiered.html | 7 ------- httemplate/elements/tr-select-cust_location.html | 2 +- httemplate/misc/xmlhttp-cust_bill_pkg-calculate_taxes.html | 2 +- httemplate/misc/xmlhttp-cust_main-email_search.html | 2 +- 9 files changed, 9 insertions(+), 22 deletions(-) diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index d277c282f..1553a42df 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -77,7 +77,7 @@ if ( -e $addl_handler_use_file ) { use HTML::TableExtract qw(tree); use HTML::FormatText; use HTML::Defang; - use JSON; + use JSON::XS; # use XMLRPC::Transport::HTTP; # use XMLRPC::Lite; # for XMLRPC::Serializer use MIME::Base64; diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 3fd61efd8..c8ad430b2 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -581,7 +581,7 @@ use vars qw($DEBUG); use Carp; use Storable qw(nfreeze); use MIME::Base64; -use JSON; +use JSON::XS; use FS::UID qw(getotaker); use FS::Record qw(qsearchs); use FS::queue; @@ -726,10 +726,7 @@ sub job_status { @return = ( 'error', $job ? $job->statustext : $jobnum ); } - #to_json(\@return); #waiting on deb 5.0 for new JSON.pm? - #silence the warning though - my $to_json = JSON->can('to_json') || JSON->can('objToJson'); - &$to_json(\@return); + encode_json \@return; } diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index dfe52f109..a469beb7f 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -19,7 +19,7 @@