From 3268ae4a001561c7dcaf9ba3d51168ab70afe901 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 21 Apr 2014 00:07:31 +0200 Subject: [PATCH] Bug 12114: Fix encoding problem with reports JSON web service (staff) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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. Followed test plan. Result as expected. Signed-off-by: Marc Véron Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- svc/report | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svc/report b/svc/report index 0cff7dc4c1..839a91b403 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); } } -- 2.39.2