Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jun 2012 at 14:40 UTC
Updated:
25 Jul 2012 at 18:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
esbenvb commentedHere is a patch for the current 7.x-3.x branch.
It might screw up other things in some installations, but fixes the issue for me.
Comment #2
wwedding commentedThis is a problem with pretty much any data that is being expressed that isn't in an array or object form already; strings, booleans, integers, etc. json_encode() doesn't really do what it seems like it should for these.
My fix was to just wrap the content in an array inside the REST server's render_json() function...
Comment #3
wwedding commentedI guess my fix is specific to the built in REST server and the original poster's patch might be a more general fix? Maybe this isn't a problem with other server types.
@esbenvb are you using REST?
Comment #4
kylebrowning commentedI like the patch in #1 better, but #2 raises a good point!
Anyone else want to chime in?
Comment #5
ygerasimov commentedI think we should proceed with second patch as it breaks our APIs less that first one.
Comment #6
marcingy commentedSecond one makes me happier but the code has a few style issues
Missing space after // and line is over characters long.
Missing space after if
Comment #7
wwedding commentedSorry about that, forgot to run the patch through code sniffer before submitting.
Shortened the comment, added a space, added a full stop, fixed the spacing around the conditional.
Comment #8
ygerasimov commentedLooks good to me.
Comment #9
kylebrowning commentedComment #10
kylebrowning commentedI hope this doesnt break anyones clients :(
Comment #11
wwedding commentedIt might, at least temporarily. But only because those clients had to be coded to handle improper non-JSON responses when they expected JSON responses in the first place, right?
Comment #12
kylebrowning commentedIll just make it apparent in the release notes that its a potential breaker.