Welcome, Guest
Username: Password: Remember me

TOPIC: debug on remotecontrol

debug on remotecontrol 1 year 4 weeks ago #97619

  • nicola_86
  • nicola_86's Avatar
Hi,
I'd like to see the parameters that arrive within my json call. Is it possible through some prints in some point of the file remotecontrol.php? I was trying to understand reading the file and doing some test.
Any help would be appreciate.
thanks
The administrator has disabled public write access.

debug on remotecontrol 1 year 4 weeks ago #97620

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
When you use json, go to application\libraries\LSjsonRPCServer.php. In the very beginning line 24 your json reuqest will be converted to a request. If you output that you will see what you have. When you get no response on remotecontrol most probably the json_decode fails due to incorrect json string. We should be able to trap that in the future and deliver a nice error.
---
Menno Dekker
The administrator has disabled public write access.
The following user(s) said Thank You: nicola_86

debug on remotecontrol 1 year 3 weeks ago #97633

  • nicola_86
  • nicola_86's Avatar
thanks for the suggestion, it works. :)
however with request with a wrong json sintaxt it's better to put the print before decoding it
I had a good result doing that:

// reads the input data
print_r(file_get_contents('php://input'));
$request = json_decode(file_get_contents('php://input'),true);
print_r("request: ");
print_r($request);

Thanks a lot!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.145 seconds
Donation Image