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
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']]
);
}