Problem/Motivation
Background:
We are querying Salesforce in our custom module to check if a user exists in Salesforce when users sign up to our Drupal site. To do that we're using the Rest client ("salesforce.client" service) along with the Drupal\salesforce\Commands\QueryResult class to parse the Rest call result. We're also using the "AjaxLogin" module which allows users to register using Ajax.
The issue:
When a user registers via Ajax, they get an Ajax error, the status code is 200, but the reason for the error is "parseerror".
The reason for the parse error is there's empty Array() outputs in our ajax json response just before the actual json array of commands.
This is output because when we instantiate "QueryResult" class in our hook_user_insert empty `Array()`s get output in our json response because there's a print_r in the constructor of QueryResult class.
Proposed resolution
Remove the print_r from the constructor. Or please advise us if we should be using a different class or method to parse Rest call results.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3186237-remove-queryresult-print-r-2.patch | 522 bytes | baysaa |
Comments
Comment #2
baysaa commentedAttached patch thanks!
Comment #3
aron novakThis looks necessary.
Comment #5
aaronbaumanYeah, no brainer.
Thanks for the patch