r80211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80210‎ | r80211 | r80212 >
Date:00:16, 14 January 2011
Author:awjrichards
Status:deferred
Tags:
Comment:
Added watchdog logging for contribution_tracking update; re-added user info to the normalized message for subscr_signup so we capture as much personal info as we can when the user signs up
Modified paths:
  • /civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm_common.inc (modified) (history)
  • /civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module (modified) (history)

Diff [purge]

Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -137,7 +137,7 @@
138138 return TRUE;
139139 } elseif ( $msg_status == 2 ) {
140140 watchdog( 'recurring', 'Frame from queue currently not processable, leaving in queue.' );
141 - return FALSE;
 141+ return TRUE;
142142 } else {
143143 watchdog( 'recurring', 'Could not process frame from queue.', array(), WATCHDOG_ERROR );
144144 return FALSE;
@@ -565,7 +565,7 @@
566566 }
567567
568568 // Contact info
569 - if ( $msg[ 'txn_type' ] == 'subscr_payment' || $msg[ 'txn_type' ] == 'subscr_modify' ) {
 569+ if ( $msg[ 'txn_type' ] == 'subscr_signup' || $msg[ 'txn_type' ] == 'subscr_payment' || $msg[ 'txn_type' ] == 'subscr_modify' ) {
570570 $msg_normalized[ 'first_name' ] = $msg[ 'first_name' ];
571571 $msg_normalized[ 'last_name' ] = $msg[ 'last_name' ];
572572 $split = split("\n", str_replace("\r", '', $msg[ 'address_street' ]));
Index: civicrm/trunk/sites/all/modules/queue2civicrm/queue2civicrm_common.inc
@@ -281,7 +281,14 @@
282282 */
283283 function _queue2civicrm_update_contribution_tracking( $msg, $contribution ) {
284284 if (array_key_exists( 'contribution_tracking_id', $msg )) {
285 - db_query('UPDATE {contribution_tracking} SET contribution_id = %d WHERE id = %d LIMIT 1', $contribution['id'], $msg['contribution_tracking_id']);
 285+ $result = db_query('UPDATE {contribution_tracking} SET contribution_id = %d WHERE id = %d LIMIT 1', $contribution['id'], $msg['contribution_tracking_id']);
 286+ if ( !$result ) {
 287+ watchdog( 'queue2civicrm', "There was a probme updating contribution_tracking for message: %msg", print_r( $msg, true ), ERROR );
 288+ return FALSE;
 289+ } else {
 290+ watchdog( 'queue2civicrm', 'Successfuly updated contribution_tracking for message: %msg', print_r( $msg, true));
 291+ return TRUE;
 292+ }
286293 }
287294 }
288295

Status & tagging log