CRM-15320-created foreach loop so that it processes the array of arrays rather than...
authorMaggie <maggie.epps@gmail.com>
Tue, 16 Sep 2014 20:33:44 +0000 (16:33 -0400)
committerMaggie <maggie.epps@gmail.com>
Tue, 16 Sep 2014 20:33:44 +0000 (16:33 -0400)
CRM/Member/BAO/Membership.php

index 12860a568c711ea3ab8ecc0fc987b7f7fa530fe4..77bcf4a06eb5805ab7ba3a0d770315ea37d370d3 100644 (file)
@@ -2852,10 +2852,12 @@ WHERE      civicrm_membership.is_test = 0";
 
     //CRM-13981, create new soft-credit record as to record payment from different person for this membership
     if (!empty($contributionSoftParams)) {
-      $contributionSoftParams['contribution_id'] = $contribution->id;
-      $contributionSoftParams['currency'] = $contribution->currency;
-      $contributionSoftParams['amount'] = $contribution->total_amount;
-      CRM_Contribute_BAO_ContributionSoft::add($contributionSoftParams);
+      foreach ($contributionSoftParams as $contributionSoft){
+        $contributionSoft['contribution_id'] = $contribution->id;
+        $contributionSoft['currency'] = $contribution->currency;
+        $contributionSoft['amount'] = $contribution->total_amount;
+        CRM_Contribute_BAO_ContributionSoft::add($contributionSoft);
+      }
     }
 
     // store contribution id