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

Remove unused code variable #12299

Merged
merged 1 commit into from
Jun 11, 2018
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Code readability fix - $objects is passed to cancelRecurContribution but never used, tidy up

Before

Code less readable

After

Code more readable

Technical Details

If $objects is set then the ipn cancelled() function is called. It is never set & the function appears intended to deal with a cancelled payment not a cancelled recurring so this just seems to be a code hangover

I checked the places this is called from

$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
      );

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

object & activity params are both null

    CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($contributionRecur['id'], NULL);

Comments

Follow up from #11964

@civibot
Copy link

civibot bot commented Jun 11, 2018

(Standard links)

@colemanw colemanw merged commit df653d2 into civicrm:master Jun 11, 2018
@colemanw colemanw deleted the cancel_recur branch June 11, 2018 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants