CRM-4523 Confirmation of pending payment incorrectly alters membership join date

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0, 2.2.3, 3.0
    • Fix Version/s: 3.1
    • Component/s: CiviMember
    • Labels:
      None

      Description

      We are seeing a behaviour in 2.0.x and 2.2.3 where a CiviContribute join or renew form will lose membership join dates as a member renews, if they select "Pay later by check". The join date is correct after the renewal, but is changed to the start date when the pending status is updated by the administrator.

      To reproduce on demo:

      0. Configure a CiviContribute renewal page with Pay Later enabled

      1. Configure a membership for Tester McTester with join_date and start_date = 2008

      2. Renew the membership using the CiviContribute page, using "Pay later by check" to set payment = pending

      3. Check membership details

      4. Find membership pending as admin, click "edit" for pending membership

      5. Change payment status from Pending to Completed. When you click Save on this form, the join date for the membership will be set incorrectly.

      6. Verify that the join date is now incorrect for this membership.

      Example with links and images at http://forum.civicrm.org/index.php/topic,8136.0.html

      Confirmed in 2.0.x and 2.2.3

        Attachments

        1. CRM-4523-2.patch
          4 kB
          Chris Burgess
        2. Picture 5.png
          40 kB
          David Greenberg
        3. Picture 6.png
          54 kB
          David Greenberg

          Activity

          [CRM-4523] Confirmation of pending payment incorrectly alters membership join date
          Kurund Jalmi added a comment -

          Batch move to verification

          Chris Burgess added a comment -

          Tried Kiran's patch on v2.2.x series but it didn't handle memberships generated with Pending status.

          When a membership is created with Pending status, the join/start/end dates aren't set. The earlier patch on this ticket calls

          CRM_Member_BAO_Membership::fixMembershipStatusBeforeRenew( $currentMembership, $changeToday = null );

          which will result in calling CRM_Member_BAO_MembershipStatus::getMembershipStatusByDate(), which doesn't work if the membership has no date

          Not sure if this patch is the /correct/ fix but it does appear to resolve the issue for us. Also had to reflect the same change (don't try calling fixMembershipStatusBeforeRenew if status is pending) in BaseIPN.php.

          Chris Burgess added a comment -

          The previous patch is against v2.2 branch, not trunk.

          Kiran Jagtap added a comment -

          To exclude pending memberships from $currentMembership array - code is committed w/ r23209
          also check here ( svn diff -r23208:23209 http://svn.civicrm.org/civicrm/trunk/ )

          Piotr Szotkowski added a comment -

          Verified in r23433.

          Yashodha Chaku added a comment -

          assigning for 3.1 verification

          David Greenberg added a comment -

          The original bug looks fine (Join Date is preserved). However, the End Date in the confirmation email is incorrect after admin completion of a pending pay later renewal:

          • start with 'Current' General membership, end date = Nov 30, 2010
          • the member logged in and renewed their membership with Pay later (via online contribution page).
          • as admin, go to Edit Membership form and check 'Update Membership Payment' - mark the Pending pay later contribution as "Completed" and Save
          • the Membership record end date is properly updated to Nov 30, 2012 and the contribution record is correctly updated to Completed
          • HOWEVER, the email to the member shows the old (UN-renewed) end date of Nov 30, 2010
          David Greenberg added a comment -

          End date bug (previous comment) is fixed. However, I found one other problem with this workflow. If you follow the steps in the original issue AND click Record Membership Payment for the initial membership (so there is a Completed contribution for the 2008 membership signup) - then when you go to edit the Membership form in order to update the Pending renewal payment - the query logic which should notice that there's a pending contribution and give Update Membership Payment checkbox is NOT working (checkbox is not present).

          I've attached 2 screenshots

          • one showing the checkbox present when the only associated contribution is a Pending contrib for the renewal.
          • second screenshot shows the original (completed) contrib plust the Pending contrib - and NO 'Update Membership' checkbox

          I suspect the query looking for the Pending contrib is just finding the first contrib (completed) and therefore not seeing the Pending one.

          David Greenberg added a comment -

          Update Membership checkbox present if the ONLY contribution linked to membership is Pending.
          Missing if there is also a previously Completed contribution

          David Greenberg added a comment -

          Bugs reported in prior comments are fixed.

            People

            • Assignee:
              Kiran Jagtap
              Reporter:
              Chris Burgess

              Dates

              • Created:
                Updated:
                Resolved: