Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59846


Change subject: 'amount' field is now required
......................................................................

'amount' field is now required

Also, begin to clean up some missing field warnings.

Change-Id: If35da918d32a7040712b2fd0424cbb5da9fb4cf7
---
M sites/all/modules/queue2civicrm/recurring/recurring.module
1 file changed, 11 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm 
refs/changes/46/59846/1

diff --git a/sites/all/modules/queue2civicrm/recurring/recurring.module 
b/sites/all/modules/queue2civicrm/recurring/recurring.module
index 92b90d1..7dd5ec3 100644
--- a/sites/all/modules/queue2civicrm/recurring/recurring.module
+++ b/sites/all/modules/queue2civicrm/recurring/recurring.module
@@ -635,7 +635,9 @@
          $msg_normalized[ 'last_name' ] = $msg[ 'last_name' ];
          $split = split("\n", str_replace("\r", '', $msg[ 'address_street' ]));
          $msg_normalized[ 'street_address' ] = $split[0];
-         $msg_normalized[ 'supplemental_address_1' ] = $split[1];
+         if ( count( $split ) > 1 ) {
+           $msg_normalized[ 'supplemental_address_1' ] = $split[1];
+         }
          $msg_normalized[ 'city' ] = $msg[ 'address_city' ];
          $msg_normalized[ 'state_province' ] = $msg[ 'address_state' ];
          $msg_normalized[ 'country' ] = $msg[ 'address_country_code' ];
@@ -647,7 +649,9 @@
          $msg_normalized[ 'first_name_2' ] = implode(" ", $split);
          $split = split("\n", str_replace("\r", '', $msg[ 'address_street' ]));
          $msg_normalized[ 'street_address_2' ] = $split[0];
-         $msg_normalized[ 'supplemental_address_2' ] = $split[1];
+         if ( count( $split ) > 1 ) {
+           $msg_normalized[ 'supplemental_address_2' ] = $split[1];
+         }
          $msg_normalized[ 'city_2' ] = $msg[ 'address_city' ];
          $msg_normalized[ 'state_province_2' ] = $msg[ 'address_state' ];
          $msg_normalized[ 'country_2' ] = $msg[ 'address_country_code' ];
@@ -676,7 +680,6 @@
       watchdog( 'recurring', "There is no contribution tracking id associated 
with this message.", array(), WATCHDOG_NOTICE );
     }
 
-    $msg_normalized[ 'gateway' ] = ( strlen( $msg[ 'gateway' ] )) ? $msg[ 
'gateway' ] : 'paypal';
        $msg_normalized[ 'gateway_txn_id' ] = $msg[ 'txn_id' ];
        $msg_normalized[ 'original_currency' ] = $msg[ 'mc_currency' ];
        $msg_normalized[ 'original_gross' ] = $msg[ 'mc_gross' ];
@@ -707,6 +710,8 @@
     
     if ( isset( $msg[ 'amount3' ] ) ) {
       $msg_normalized[ 'amount' ] = $msg[ 'amount3' ];
+    } elseif ( isset( $msg[ 'mc_amount3' ] ) ) {
+      $msg_normalized[ 'amount' ] = $msg[ 'mc_amount3' ];
     }
     
     if ( isset( $msg[ 'subscr_date' ] ) ) {
@@ -732,7 +737,9 @@
       }
     }
   }
-  
+
+  $msg_normalized[ 'gateway' ] = ( strlen( $msg[ 'gateway' ] )) ? $msg[ 
'gateway' ] : 'paypal';
+
   $msg_normalized[ 'date' ] = $timestamp;
   
   return $msg_normalized;

-- 
To view, visit https://gerrit.wikimedia.org/r/59846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If35da918d32a7040712b2fd0424cbb5da9fb4cf7
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to