Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.4, 4.0.4
-
Fix Version/s: 3.4.5
-
Component/s: Core CiviCRM
-
Labels:None
Description
hook_civicrm_membershipTypeValues() performs unexpectedly.
I thought it would let me set the minimum_fee to 0 for some membership types, and it does work okay when loading the membership contribution page, but on submit, I still get the error: "The Membership you have selected requires a minimum contribution of $ 300.00"
Turns out (as lobo pointed out on IRC), formRule() is not using the hook-modified values. Lobo suggested caching the values of the function buildMembershipTypeValues() in the form, and then letting formRule() use that cached data.
This patch makes those changes.