Bug 12114 - Reports web service JSON output has an encoding problem
Summary: Reports web service JSON output has an encoding problem
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-20 21:15 UTC by Katrin Fischer
Modified: 2014-12-07 20:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 12114: Fix encoding problem with reports JSON web service (opac) (1.58 KB, patch)
2014-04-20 22:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 12114: Fix encoding problem with reports JSON web service (staff) (1.23 KB, patch)
2014-04-20 22:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
[Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (opac) (1.68 KB, patch)
2014-04-21 17:45 UTC, Marc Véron
Details | Diff | Splinter Review
[Signed-off] Bug 12114: Fix encoding problem with reports JSON web service (staff) (1.42 KB, patch)
2014-04-21 17:48 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 12114: Fix encoding problem with reports JSON web service (opac) (1.74 KB, patch)
2014-04-25 13:00 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 12114: Fix encoding problem with reports JSON web service (staff) (1.47 KB, patch)
2014-04-25 13:00 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 12114 [QA Followup] - Use JSON instead of JSON::XS (832 bytes, patch)
2014-04-25 13:01 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2014-04-20 21:15:54 UTC
To reproduce:
- catalog a record that includes umlauts äöü
- write a report, that has the record in the result set
- access the JSON output of the report
  .../cgi-bin/koha/svc/report?id=1
- verify the umlaut displays wrong
- switch the encoding in the browser to 'western'/latin1
- verify the umlaut now displays correctly
Comment 1 Katrin Fischer 2014-04-20 22:12:47 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2014-04-20 22:12:55 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2014-04-21 17:45:24 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2014-04-21 17:48:08 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2014-04-25 12:46:43 UTC
Patch uses JSON::XS which isn't in our list of dependencies. It may not be needed though. JSON has the same subroutine.
Comment 6 Kyle M Hall (khall) 2014-04-25 12:49:43 UTC
(In reply to Kyle M Hall from comment #5)
> Patch uses JSON::XS which isn't in our list of dependencies. It may not be
> needed though. JSON has the same subroutine.

It appears that both JSON:PP and JSON:XS support encode_json.
Comment 7 Kyle M Hall (khall) 2014-04-25 12:53:13 UTC
(In reply to Kyle M Hall from comment #6)
> (In reply to Kyle M Hall from comment #5)
> > Patch uses JSON::XS which isn't in our list of dependencies. It may not be
> > needed though. JSON has the same subroutine.
> 
> It appears that both JSON:PP and JSON:XS support encode_json.

I have verified encode_json works just fine using both PP and XS versions of JSON.
Comment 8 Kyle M Hall (khall) 2014-04-25 13:00:01 UTC
Created attachment 27619 [details] [review]
Bug 12114: Fix encoding problem with reports JSON web service (opac)
Comment 9 Kyle M Hall (khall) 2014-04-25 13:00:30 UTC
Created attachment 27620 [details] [review]
Bug 12114: Fix encoding problem with reports JSON web service (staff)
Comment 10 Kyle M Hall (khall) 2014-04-25 13:01:52 UTC
Created attachment 27621 [details] [review]
Bug 12114 [QA Followup] - Use JSON instead of JSON::XS
Comment 11 Galen Charlton 2014-04-25 15:37:30 UTC
Pushed to master.  Thanks, Katrin!
Comment 12 Katrin Fischer 2014-04-25 15:39:10 UTC
Thanks Galen for providing the solution :)