Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(dev/core/56) Cancel Recurring Contribution activity should has a source record id #11964

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

scardinius
Copy link
Contributor

Overview

Cancel Recurring Contribution doesn't have a source record id but there should be a recurring contribution id

Before

civicrm_activity.record_source_id IS NULL

After

civicrm_activity.record_source_id has a recurring contribution id

Technical Details

// current, invalid
'source_record_id' => CRM_Utils_Array::value('source_record_id', $activityParams),
// fixed
'source_record_id' => $dao->recur_id,

Comments

Link to gitlab https://lab.civicrm.org/dev/core/issues/56

@eileenmcnaughton
Copy link
Contributor

test this please

@eileenmcnaughton
Copy link
Contributor

I checked the places this is called from

  1. $objects is null, $activity_params does not contain 'source_record_id'
      $activityParams
        = array(
          'subject' => $this->_mid ? ts('Auto-renewal membership cancelled') : ts('Recurring contribution cancelled'),
          'details' => $message,
        );
      $cancelStatus = CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution(
        $this->_subscriptionDetails->recur_id,
        NULL,
        $activityParams
      );
  1. object & activity params are both null
  return CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($params['id'], CRM_Core_DAO::$_nullObject) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while cancelling recurring contribution'));

  1. object & activity params are both null
    CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($contributionRecur['id'], NULL);

Am giving this merge on pass as I agree that source_record_id is not currently populated & the recur record makes sense.

Will do follow up to remove $objects

@seamuslee001
Copy link
Contributor

Merging as per the tag

@seamuslee001 seamuslee001 merged commit c9baa85 into civicrm:master Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants