Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hi there,
First of all thanks for this module. It saved me some time.
But I found a bug that was annoying me when I was passing some query information ("The SQL WHERE clause without the word “where”."). So I need it fixed.
Here's my code to make it work:
function _sugarondrupal_rest_serialize_request($url, $method, $params) {
// fguerra
$data = array(
'method' => $method,
'input_type' => 'serialize',
'response_type' => 'serialize',
'rest_data' => serialize($params)
);
// for now is all POST
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$output = drupal_http_request($url, $headers, 'POST', http_build_query($data, '', '&'));
return unserialize($output->data);
}
and of course that will be likewise to the _sugarondrupal_rest_json_request function.
Comment | File | Size | Author |
---|---|---|---|
#5 | sugarondrupal_728756.patch | 2.09 KB | ilo |
Comments
Comment #1
joelbox-Mondial-IT CreditAttribution: joelbox-Mondial-IT commentedHi it is not clear to me if you mean your code improves this (follows) or if this is the latest improved code. Could you clarify, pls.
taken from 27-3-2010 download:
Comment #2
ngstigator CreditAttribution: ngstigator commentedUnless a content-type header is specified, the receiving script may not get the posted content. More info at http://plosquare.blogspot.com/2010/03/solution-for-post-empty-after.html
Comment #3
ilo CreditAttribution: ilo commentedActually, there is a TODO in the signature of this function to provide also POST (and DELETE I'd say) according to SugarCRM REST specs, but this is not the way to go, I'd prefer a more worked solution.
Comment #4
ilo CreditAttribution: ilo commentedOk, lets get this one in. I have verified that using SERIALIZE (uppercase and lowercase) I'm unable to perform login, however get_server_info works. Before starting to debug this in the SugarCRM service, I've changed the REST request to always perform POST operations.
Making this change sugarondrupal_set_entry should start working.
Thank you all!
Committed as: http://drupal.org/cvs?commit=468584
Note: Accidentaly I broke the login in previous commits, I'm fixing that in this issue also.
Note: I'm making committs without the whole reviewing proccess because I'm doing a 'lets get a good base code' first. Once I finish this clean up, I promise I'll go through the NR-RBTC-Fixed issue queue process.
Comment #5
ilo CreditAttribution: ilo commentedSorry, I forgot the committed patch.