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

duplicate entries in civicrm_contribution_product for a given contribution_id

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.0, 2.1.2
    • Fix Version/s: 2.1.4
    • Component/s: CiviContribute
    • Labels:
      None

      Description

      Version: 2.0.3

      Problem:
      A contributor fills out the contribution form and selects a premium, clicks Continue, verifies the data on the confirmation page and then clicks Continue again. They are redirected to, for example, PayPal. For whatever reason, on some PayPal page they click to return to the originating site before they have completed the transaction, and they are returned to the contribution page. At this point, a record has already been created in the civicrm_contribution_product table for the contribution. They now step through the process again. Instead of updating the existing record in the civicrm_contribution_product table, CiviContribute creates a new record for the same contribution ID. Not a big deal, the contribution goes through, but now when the contribution details for the contact are viewed, that single contribution shows up twice in the list. This is a result of the way the tables are joined in the select statement for reviewing contribution history.

      Expected behavior:
      CiviContribute should have noticed that a premium already existed for the contribution ID and updated the existing record rather than inserting a new one.

      Fix:
      The attached patch minimally fixes the problem, but still doesn't address the case where they return to the contribution page and then select "No, Thank you." for the premium, in which case all entries for the contribution should be removed from the table civicrm_contribution_product.

        Attachments

          Activity

            People

            • Assignee:
              sunil Sunil Pawar
              Reporter:
              nkinkade Nathan Kinkade
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: