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

incorrect default financial_type_id on credit card membership creation

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: CiviMember
    • Labels:
      None

      Description

      When creating a membership using the "Submit credit card membership" button for an individual contact, the user is given the option of choosing a membership type or a price set.

      If you choose the membership type and leave the priceset emtpy, and you have a default financial type for the membership type that you have chosen, the contribution record that is created will not be assigned the default financial type for the given membership type. Instead, it is assigned the financial type for the priceset "default_membership_type_amount".

      In CRM/Member/Form/Membership.php (which is called when you fill out the form) , in the postProcess function on line 1083, if priceSet is not set, it is filled in via the CRM_Member_BAO_Membership::createLineItems function. The first line of that function sets the priceSet to:

      CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', 'default_membership_type_amount', 'id', 'name');

      This value is passed by reference, so, later on in postProcess, on line 1297, the code checks to see if there is a value for priceSetId. It finds a value and then sets the financial_type_id according to the incorrect priceSetId default instead of setting it according to the Membership Type value.

      I'm not sure how to fix. Here are some proposals that are not mutually exclusive.

      • Change the credit card submit form to expose the financial type id with the proper default set. Then, use this value rather than trying to derive it (it's exposed if you do a membership form that is not using a credit card).
      • In CRM_Member_BAO_Membership::createLineItems, don't pass $priceSetId by reference ($qf is already passed by reference and is being assigned the value used in this function so we shouldn't need to made available twice).

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              jamie Jamie McClelland
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: