Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11531

deleteMembership fails if hard coded activity types are not present

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.6
    • Fix Version/s: 4.2.7
    • Component/s: CiviMember
    • Labels:
      None

      Description

      The deleteMembership function in CRM/Member/BAO/Membership.php has several Hard Coded activities types. If any of those activity types are not present then the delete fails.

      Starting at (or about) line 580 the following change/patch eliminates that problem.

      $params = array(
      'source_record_id' => $membershipId,
      'activity_type_id' => array(), // Removed Hard Coded Activity Types
      );

      $membershipActivities = array('Membership Signup','Membership Renewal','Change Membership Status','Change Membership Type','Membership Renewal Reminder');
      foreach($membershipActivities AS $memAct)
      {
      $tId = array_search($memAct, $activityTypes);
      if($tId !== false)

      { $params["activity_type_id"][] = $tId; }

      }

      Sorry it's not really up to snuff... but it's a small snippet so I hope you'll forgive me.

        Attachments

          Activity

            People

            • Assignee:
              ravish.nair Ravish Nair
              Reporter:
              mneimeyer Matt Neimeyer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: