From: Elliott Eggleston Date: Mon, 8 Aug 2016 18:27:48 +0000 (-0400) Subject: Check the right next_sched dates for update X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=48f50324642fa04a915b8930ad1e2e456f751266;p=civicrm-core.git Check the right next_sched dates for update Need to look at $existing, not $params. --- diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index 99c49a2f5a..70ad805aff 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -861,7 +861,7 @@ INNER JOIN civicrm_contribution con ON ( con.id = mp.contribution_id ) else { // Only update next sched date if it's empty or 'just now' because payment processors may be managing // the scheduled date themselves as core did not previously provide any help. - if (empty($params['next_sched_contribution_date']) || strtotime($params['next_sched_contribution_date']) == + if (empty($existing['next_sched_contribution_date']) || strtotime($existing['next_sched_contribution_date']) == strtotime(date('Y-m-d'))) { $params['next_sched_contribution_date'] = date('Y-m-d', strtotime('+' . $existing['frequency_interval'] . ' ' . $existing['frequency_unit'])); }