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

Membership line items are duplicated when a membership is created or renewed with priceset containing multiple memberships

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.14, 4.7.15
    • Fix Version/s: 4.7.17
    • Component/s: None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      Step to replicate

      1. Create a price set with multiple price fields or options that minimally include membership type options for more than one organization i.e user should able to purchase more than 2 memberships from different organizations.
      2. Assign the price set to Contribution page

      Do a membership purchase or renew membership using contribution page. We are checking for backoffice purchase using the price set, expecting it too will have same problem and will be solved by same fix.

      Once the membership is purchased view the contribution. You will notice the line items are not matched with the actual line items selected during purchase.

      There is an extra line item that replicates a) the price_field_id for the first membership and b) the membership_id of the second membership price_field. There are also related entries for the extra line item in the financial_item and entity_financial_trxn table.

      Fix: initialize array for membershipLineItems at appropriate place in code. Create upgrade script to repair databases by removing duplicated entries in civicrm_line_item, civicrm_financial_item, and civicrm_entity_financial_trxn tables.

        Attachments

        1. upgrade_script.mysql
          4 kB
          Joe Murray
        2. upgrade_script.mysql
          4 kB
          Joe Murray
        3. upgrade_script.mysql
          1 kB
          Joe Murray
        4. upgrade_script.v3.mysql
          4 kB
          Joe Murray

          Activity

            People

            • Assignee:
              pradeep.nayak Pradeep Nayak
              Reporter:
              pradeep.nayak Pradeep Nayak
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: