CRM-17655 editing recurring through form causes error
authoreileen <emcnaughton@wikimedia.org>
Thu, 24 Dec 2015 00:16:33 +0000 (13:16 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 24 Dec 2015 00:16:33 +0000 (13:16 +1300)
On editing I found previous patches for CRM-17655 had caused a situation where the ID for the recurring contribution
was not always being correctly determined

Change-Id: I74394d6f33b0a68ee73d0cc4be3efb5563bc6406

CRM/Contribute/BAO/Contribution.php

index 46a830b7c1891fd4b52ca7ed614578ea7de3b50e..74c6aefcff83c89b863bbd6e85d1046c80d58f57 100644 (file)
@@ -201,7 +201,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
 
     if (self::isUpdateToRecurringContribution($params)) {
       CRM_Contribute_BAO_ContributionRecur::updateOnNewPayment(
-        $params['contribution_recur_id'],
+        (!empty($params['contribution_recur_id']) ? $params['contribution_recur_id'] : $params['prevContribution']->contribution_recur_id),
         $contributionStatus[$params['contribution_status_id']]
       );
     }