Don't allow users to save an End Date for a Membership if the Duration of the selected membership type has a duration unit of "lifetime".
Add a formRule to the add / edit Membership form (CRM/Member/Form/Membership.php):
- check duration_unit of selected membership type
- if duration_unit == 'lifetime' and End Date is not NULL, formRule error on End Date field is:
"The selected Membership Type has a 'life time' duration. You can not specify an End Date for 'life time' memberships. Please clear the End Date OR select a different Membership Type."
---- Original Post ------------
A membership type set to a rolling period of 1 lifetime inserts a member record with a join date, start date, but no end date (thus a never expiring "lifetime). However, a user can inadvertently set an end date in the member record dialog, which negates the lifetime status. If a lifetime-type membership type is defined, the membership form should either hide the end date field and/or override a value in that field through the update membership script.