7

Consider this:

  1. Wilma becomes a member on 1 Jan 2016, but does not renew at the end of the year.

  2. (so throughout 2017, 2018, Wilma is not a member)

  3. Wilma joins again in Jan 2019.

According to the documentation, CiviMember will find the original membership and change the start date to 1 Jan 2019 and the end date to 31 Dec 2019, and set the status to live (or new etc.)

This now looks like Wilma has been a member since 1 Jan 2016, but that's not the case.

Is there a way to have CiviMember create a new membership and leave old expired ones (i.e. those with "member: No" configured for their membership status) as-was?

There's a similar question that seems to be focussed on a WordPress/Caldera forms environment, but I'm asking about CiviCRM's native forms, hence the separate question.

2 Answers 2

6

I do not believe this is possible as of CiviCRM 5.4 at least.

The logic is coded in civicrm/CRM/Member/BAO/Membership.php so the only way to override this is with a core override file, which is a maintenance headache since it will need re-working on ever upgrade.

This patch seems to make it work as I think it should:

diff --git a/civicrm/CRM/Member/BAO/Membership.php b/all/modules/civicrm/CRM/Member/BAO/Membership.php
index 18269014..7713ee9e 100644
--- a/civicrm/CRM/Member/BAO/Membership.php
+++ b/civicrm/CRM/Member/BAO/Membership.php
@@ -1860,6 +1860,14 @@ INNER JOIN  civicrm_contact contact ON ( contact.id = membership.contact_id AND
     $currentMembership = CRM_Member_BAO_Membership::getContactMembership($contactID, $membershipTypeID,
       $is_test, $membershipID, TRUE
     );
+
+    // -------Begin patch to create new memberships if last one had expired-------
+    if ($currentMembership && !$currentMembership['is_current_member']) {
+      // Force a new membership.
+      $currentMembership = NULL;
+    }
+    // -------End patch to create new memberships if last one had expired-------
+
     if ($currentMembership) {
       $renewalMode = TRUE;

7
  • 1
    If you leave the old membership expired and create a new one, does it open up potential false positives on searches for people with expired memberships?
    – Laryn
    Jan 25, 2019 at 15:41
  • Yes it does. It also means that if I search 'Current Member: no' then there is a false positive because of the expired membership. I think this is the fault of the membership search though. I think the data should accurately reflect the truth, and I think the search should enable interpretation of that data back to real world truth. I don't think we should bend the data to fit the interpretation. But yes, this is important to understand and ultimately iron out! Jan 28, 2019 at 9:01
  • 1
    @AndrewWest You may be interested in github.com/artfulrobot/patchwork which auto-patches core on the fly (as in if you upgrade core it notices the change and reapplies the patch). Sep 27, 2019 at 11:32
  • 2
    Just noting that this code is no longer in CRM_Member_BAO_Membership and has been moved to CRM_Contribute_Form_Contribution_Confirm. It's in a function called legacyProcessMembership() though so I imagine it'll change at some point Sep 5, 2022 at 17:55
  • 1
    The Link posted by @artfulrobot is now located at lab.civicrm.org/extensions/patchwork
    – emma
    Apr 12, 2023 at 13:03
0

Not a direct answer but you could create a different membership type each year and disable the previous year's type. It sounds like you'd want these reported separately in reports anyway?

2
  • Clever! But I think that will interfere with the people who genuinely do renew their memberships each year, for whom we do want to see a continual membership. Jan 22, 2019 at 18:10
  • Or at the end of the year add a tag to people who were members that year? (e.g. 2018 member, 2019 member, etc.)
    – Laryn
    Jan 25, 2019 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.