Skip to content

Commit

Permalink
fixed issue with closing groups (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Jun 20, 2017
1 parent 8259036 commit 7b5166e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CRM/Sepa/Logic/Queue/Close.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,12 @@ protected function updateMandateStatusSQL($contributions, $new_status, $for_old_
* Update the status of all given contributions to $this->target_status_id
*/
protected function updateContributionStatus($contributions) {
$contribution_id_list = implode(',', array_keys($contributions));
$status_inProgress = (int) CRM_Core_OptionGroup::getValue('contribution_status', 'In Progress', 'name');
if (empty($contribution_id_list)) {
// this would cause SQL errors
return;
}
if ($this->target_status_id == $status_inProgress) {
// this status cannot be set via the API -> use SQL
CRM_Core_DAO::executeQuery("UPDATE civicrm_contribution SET contribution_status_id={$status_inProgress} WHERE id IN {$contribution_id_list};");
Expand Down

0 comments on commit 7b5166e

Please sign in to comment.