Membership level is miscomputed if you use "Go back" to fix a mistake
Overview
When using a ContributionPage to choose a membership type, you have the option to "Go back" and change
Reproduction steps
- Create a site with demo data (I'm using dmaster). This includes a dummy payment processor, some membership types ("General", "Student"), and a ContributionPage.
- In a private window, open the ContributionPage for membership registration (
civicrm/contribute/transact?reset=1&id=2
) - Choose the "General" membership type. Fill out dummy billing info. Continue to next page.
- On the confirmation page, read the summary. You see the "General" selection... and realize it's a mistake. You want to change.
- Press "Go Back"
- Change the membership to the correct/intended value ("Student"). Continue to the next page.
Current behavior
On the confirmation page, you see contradictory information. One section reports "Student" membership, and the other section reports "General" membership.
If you ignore this and proceed, then it will processed as a "General" membership -- using your original/mistaken value instead of final/corrected value.
The mistaken values (label/price/period) will appear in the email receipt, the Contribution
record, and the Membership
record.
Expected behavior
After changing your choice to "Student", all screens/records/emails should use the final/corrected value.
Environment information
- Browser: Firefox
- CiviCRM: 5.69
- PHP: 8.1
- CMS: D7
- Database: MySQL 8
- Web Server: Apache
Comments
I noticed this while testing other issues, so my local setup involved some other configuration. These parts probably don't matter for this scenario. But just in case there's trouble with reproducing, here's a list of other config steps:
- Make a new membership type, "Part Time Student", which recurs every 6 months
- Update the ContributionPage to enable "Part Time Student" (along with "General" and "Student")
- Change the prices on all membership types to be values like $6, $7, $8, $10. (These values are more convenient for testing iATS credit card mode.)
- Add payment processor for iATS CC (TEST88). But don't actually use it. It's just an extra one hanging around.