Doubled periods for new memberships
How to Reproduce
Doubled periods are set for new memberships when auto-renew used with the initial completed option. To reproduce it:
- create a contribution page that allows registration for a given membership type,
- ensure that the membership is set to auto-renew,
- ensure that the Smart Debit payment processor is used in the contribution page,
- enable the initial complete Smart Debit parameter (see Administer > CiviContribute > Smart Debit > General Setup),
- register as a member using the contribution page.
The new membership should have the end_date set to the current date plus the period of the membership (e.g. 1 year).
Instead, the new membership is created with an end_date that doubles the expected period.
If my tests are correct, a relatively simple fix is possible by moving the lines of the
pre hook that are triggered during the membership create, to a
post hook. To facilitate the reproduction of the fix, I'll be sending a merge request with this issue.