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

{$membership_name} token no longer working on Membership receipts (regression introduced between 4.2.1 & 4.2.4)

    Details

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

      Description

      Membership Type in membership online receipt is coming out blank when people sign up via a contribution page block (in my test scenario more than one membership type is available in the presented price-set - obviously I can't test on Demo). This is part of the default membership receipt.

      The token {$membership_name} is not being swapped out.

      The emails are fine when generated from the contribution search as an email or pdf. I have been using pay later in testing (it may be different with a credit card - not sure).

      I didn't identify the commit where this was introduced but there are several issues touching code around this for the purposes of making batch updates work during September & October. The bug was not present in 4.2.1

      This patch makes it work - although it does add a possibly (hopefully) -extraneous 'if'

      diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php
      index 5c53c5d..928a429 100644
      — a/CRM/Member/BAO/Membership.php
      +++ b/CRM/Member/BAO/Membership.php
      @@ -1176,8 +1176,14 @@ AND civicrm_membership.is_test = %2";
      $form->assign('membership_assign', TRUE);

      $form->set('membershipTypeID', $membershipParams['selectMembership']);
      -

      • $membershipTypeID = $membershipParams['selectMembership'];
        + if(is_numeric($membershipParams['selectMembership'])) { + // am putting this here in case - in the flow that I have tested this is + // but it may be there are other flows + $membershipTypeID = $membershipParams['selectMembership']; + }

        + else

        { + $membershipTypeID = $membershipParams['selectMembership'][0]; + }

        $membershipDetails = self::buildMembershipTypeValues($form, $membershipType

      $form->assign('membership_name', CRM_Utils_Array::value('name', $membership

        Attachments

          Activity

            People

            • Assignee:
              ravish.nair Ravish Nair
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: