Forms and workflows
This page describes the admin forms for memberships and membership types, and how they drive the membership lifecycle.
Membership Type form
Class: MembershipTypeForm
Path: Administration → Structure → CRM → Membership Types (add/edit)
The form collects:
| Field | Purpose |
|---|---|
| Label / machine name | Type identity |
| Description | Optional help text |
| Default target contact | Pre-filled on new memberships (MembershipForm and Membership::preSave()) |
| Membership term | Select box of available term plugins (AJAX) |
When the Membership term selection changes, an AJAX callback reloads the plugin configuration section. The selected plugin’s buildConfigurationForm() renders settings (duration, grace period, etc.). On save, validateConfigurationForm() and saveConfiguration() persist values to membership_term_config.
See Plugin configuration reference.
Add / edit membership
Class: MembershipForm (extends MembershipFormBase)
Path: CRM portal → Memberships (/crm/membership)
Add workflow
- User selects membership type, contacts, and target contact.
- If the type has a default target contact, it is pre-filled when empty.
- Optional Override start- or end date details block appears when the term plugin allows overrides (
allowOverrideStartDate/allowOverrideEndDateon the attribute). - On first save,
MembershipForm::save()calls$entity->getMembershipTerm()?->activate()after the entity is stored. This creates the initial membership period(s) and sets status.
Edit workflow
Editing an existing membership saves field changes but does not re-call activate(). Date overrides from the form are passed to the term plugin via setStartDate() / setEndDate() in MembershipFormBase::save() before redirect.
Open question: How editing interacts with existing Membership Period entities is not fully defined. See Roadmap.
Renew membership
Class: MembershipRenewForm
Path: /crm/membership/{crm_membership}/renew
Permission: renew memberships (or administer crm_membership)
- Extends
MembershipFormBasebut hides the target contact field (cannot change “member of” on renewal). - On save, calls
$entity->getMembershipTerm()?->renew()to add new period(s). - Available from the Renew operation on the membership list when the user has renew access.
Lifetime term plugins return allowRenewal(): false; the renew route may still exist but renewal is a no-op at the plugin level.
Membership Period form
Class: MembershipPeriodForm
Path: /crm/membership/periods/... (CRM portal → Memberships → Membership periods; requires administer crm_membership)
Standard content entity form for manual period CRUD. Most sites use term plugin activation/renewal instead of creating periods directly.
Module settings (planned)
A menu link targets route crm_membership.settings (Administration → Configuration → System → CRM Membership), but the route and form are not implemented yet. See Configuration and Roadmap.
Related
- Getting started — Admin paths and typical workflow
- Status and periods — What activation and renewal change on the entity
- Access control — Who can renew or edit