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

PDF receipts no longer work (from contribution search) - as they return incorrect membership data

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 3.4.6, 4.0.6
    • Fix Version/s: 4.1.0
    • Component/s: CiviContribute, CiviMember
    • Labels:
      None

      Description

      Unrelated Membership details are being added to contribution receipts when they are generated off a contribution search. The details come from the first membership record in the database.

      Reason is that

      CRM_Contribute_Form_Task_Status::getDetails

      used to return an integer for members. Now it returns an array with an empty value for the key [0]. This causes $baseIPN LoadData to load the first available membership. Patch below is a very safe fix & this functionality is currently completely broken.

      Index: CRM/Core/Payment/BaseIPN.php
      ===================================================================
      — CRM/Core/Payment/BaseIPN.php (revision 36620)
      +++ CRM/Core/Payment/BaseIPN.php (working copy)
      @@ -143,6 +143,7 @@

      if (is_array($ids['membership'])) {
      foreach ( $ids['membership'] as $id ) {
      + if(!empty($id)){
      $membership = new CRM_Member_DAO_Membership( );
      $membership->id = $id;
      if ( ! $membership->find( true ) )

      { @@ -158,6 +159,7 @@ $objects['membership'][] = $membership; $membership->free(); }

      + }
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              eileen Eileen McNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 30 minutes
                30m
                Logged:
                Time Spent - Not Specified
                Not Specified