Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-8383

hook_civicrm_membershipTypeValues doesn't affect values on form submit

    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.

        Attachments

          Activity

            People

            • Assignee:
              rohan Rohan S. Chavan
              Reporter:
              allenshaw Allen Shaw
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: