From 2b00296424eed401e503f7a53dc12e4769dc96cb Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 21 Apr 2014 00:07:31 +0200 Subject: [PATCH] [Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (staff) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Repeat tests from first patch, but this time, access the report with your staff client base URL. /cgi-bin/koha/svc/report?id= Based on paste from Galen Charlton. http://bugs.koha-community.org/show_bug.cgi?id=9915 Followed test plan. Result as expected. Signed-off-by: Marc VĂ©ron --- svc/report | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svc/report b/svc/report index 0cff7dc..839a91b 100755 --- a/svc/report +++ b/svc/report @@ -22,7 +22,7 @@ use Modern::Perl; use C4::Auth; use C4::Reports::Guided; -use JSON; +use JSON::XS; use CGI; use Koha::Cache; @@ -66,14 +66,14 @@ unless ($json_text) { else { $lines = $sth->fetchall_arrayref; } - $json_text = to_json($lines); + $json_text = encode_json($lines); if ($cache_active) { $cache->set_in_cache( $cache_key, $json_text, $report_rec->{cache_expiry} ); } } else { - $json_text = to_json($errors); + $json_text = encode_json($errors); } } -- 1.7.10.4