Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Proposed patch:
--- a/uc_salesforce/uc_sf_order/uc_sf_order.module
+++ b/uc_salesforce/uc_sf_order/uc_sf_order.module
@@ -635,6 +635,7 @@ function uc_sf_order_export($order, $name, $sfid = NULL, $manual = FALSE) {
// Export the object to Salesforce.
try {
$response = $sf->client->create(array($object), $map->salesforce);
+ drupal_alter('uc_sf_order', $response, $sf);
}
catch (Exception $e) {
drupal_set_message(t('Error exporting order to Salesforce.'), 'error');
@@ -681,6 +682,7 @@ function uc_sf_order_export($order, $name, $sfid = NULL, $manual = FALSE) {
}
try {
$product_responses = $sf->client->create($product_objects, $uc_order_products_fieldmap->salesforce);
+ drupal_alter('uc_sf_order', $product_responses, $sf);
}
catch (Exception $e) {
sf_dpm($e->faultstring, 'Ubercart order line item exception');
@@ -718,6 +720,7 @@ function uc_sf_order_export($order, $name, $sfid = NULL, $manual = FALSE) {
else {
$user_object_export = salesforce_api_fieldmap_export_create($user_map_id, $account);
$user_response = $sf->client->create(array($user_object_export), $user_map->salesforce);
+ drupal_alter('uc_sf_order', $user_response, $sf);
$account_sfid = $user_response->id;
}
}
Example usage:
/**
* Implements hook_TYPE_alter().
*/
function foo_uc_sf_order_alter($response, $sf) {
$xml_request = $sf->client->getLastRequest();
$xml_response = $sf->client->getLastResponse();
}
See also:
http://drupal.stackexchange.com/questions/89812/how-to-debug-queries-and...
Comments
Comment #0.0
kenorb CreditAttribution: kenorb commentedAdded link.
Comment #1
EvanDonovan CreditAttribution: EvanDonovan commentedI like the idea of this. This could be useful in the main Suite as well, although it's feature-frozen for Drupal 6. I may not get around to testing this for a while, but it looks good at first glance.
Comment #2
kenorb CreditAttribution: kenorb commented