Canceled pending memberships are considered "lifetime" memberships
CRM_Member_BAO_Membership::getAllContactMembership()
with $onlyLifeTime
set to TRUE
searches for all of a contact's memberships, and will return a non-empty array if a membership exists that a) has no end date, b) status is not Pending
.
Today, I came across a scenario where a pending membership was canceled. Since status was Canceled
and not Pending
it was returned as a "lifetime" membership and prevented the user from signing up online for a new membership.
This is a bit of an edge case - but I wonder if there's a better definition of a lifetime membership? If I exclude Canceled
memberships that would exclude lifetime canceled memberships (another edge case). Is there anything I can do short of querying the civicrm_membership_log
to see if the membership was ever anything but pending or canceled?