r80072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80071‎ | r80072 | r80073 >
Date:01:09, 12 January 2011
Author:awjrichards
Status:deferred
Tags:
Comment:
Fixed to for create/modified/start dates in message normalization function
Modified paths:
  • /civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module (modified) (history)

Diff [purge]

Index: civicrm/trunk/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -99,7 +99,7 @@
100100 }
101101
102102 if ($recurring_processed > 0) {
103 - watchdog('recurring', 'Successfully processed ' . $recurring_processed . ' contribution(s).');
 103+ watchdog('recurring', 'Successfully processed ' . $recurring_processed . ' subscription messages.');
104104 }
105105 else {
106106 watchdog('recurring', 'No contributions processed.');
@@ -398,7 +398,7 @@
399399 }
400400
401401 $query = "UPDATE {civicrm.civicrm_contribution_recur} SET end_date='%s' WHERE trxn_id=%d";
402 - $result = db_query( $query, date( 'Y-m-d H:i:s', $msg[ 'end_date' ] ), date( 'Y-m-d H:i:s', $msg[ 'subscr_id' ] ));
 402+ $result = db_query( $query, date( 'Y-m-d H:i:s', $msg[ 'end_date' ] ), $msg[ 'subscr_id' ] );
403403 if ( !$result ) {
404404 watchdog( 'recurring', 'There was a problem updating the subscription for EOT for subscription id: %subscr_id', array( '%subscr_id' => print_r( $msg[ 'subscr_id' ], true )), WATCHDOG_NOTICE );
405405 return 0;
@@ -627,15 +627,15 @@
628628
629629 if ( isset( $msg[ 'subscr_date' ] ) ) {
630630 if ( $msg[ 'txn_type' ] == 'subscr_signup' ) {
631 - $msg[ 'create_date' ] = strtotime( $msg[ 'subscr_date' ] );
632 - $msg[ 'start_date' ] = strtotime( $msg[ 'subscr_date' ] );
 631+ $msg_normalized[ 'create_date' ] = strtotime( $msg[ 'subscr_date' ] );
 632+ $msg_normalized[ 'start_date' ] = strtotime( $msg[ 'subscr_date' ] );
633633 } elseif( $msg[ 'txn_type' ] == 'subscr_cancel' ) {
634 - $msg[ 'cancel_date' ] = strtotime( $msg[ 'subscr_date' ] );
 634+ $msg_normalized[ 'cancel_date' ] = strtotime( $msg[ 'subscr_date' ] );
635635 }
636636 }
637637
638638 if ( $msg[ 'txn_type' ] == 'subscr_modify' ) {
639 - $msg[ 'modified_date' ] = $msg[ 'subscr_effective' ];
 639+ $msg_normalized[ 'modified_date' ] = $msg[ 'subscr_effective' ];
640640 }
641641
642642 if ( $msg[ 'txn_type' ] == 'subscr_failed' ) {

Status & tagging log