Closed (fixed)
Project:
Services
Version:
7.x-3.13
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2016 at 07:14 UTC
Updated:
3 Mar 2016 at 20:12 UTC
Jump to comment: Most recent
Making a custom field , which computes its value in value code and returns a json array.
In value code, sql query returns a result which is json encoded !
it works properly , result is returned correctly in the preview but not when the end-point is called !
Expected Result:-
[
{
"Nid": "32",
"PHP": "[{"dish1_like":"0","dish2_like":"0","dish3_like":"3","dish4_like":"0","dish5_like":"3","dish1_dislike":"4","dish2_dislike":"4","dish3_dislike":"0","dish4_dislike":"2","dish5_dislike":"1"}]"
}]Result returned :-
[
{
"Nid": "32",
"PHP": "[{"dish1_like":"0","dish2_like":"0","dish3_like":"3","dish4_like":"0","dish5_like":"3","dish1_dislike":"4","dish2_dislike":"4","dish3_dislike":"0","dish4_dislike":"2","dish5_dislike":"1"}]"
}]the php property is returned by value code !
it reutrns "e; instead of actual " .
Comments
Comment #2
kylebrowning commentedThis is a custom field that has JSON in it? Im sorry but we can't really support that from Services.
You need to alter the response from services to handle your custom case.
Look at services.api.php for ways to do so.