CRM-15958 Updating a contribution to completed with a new trxn_id writes unjoinable finanical_trxn record

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.11
    • Fix Version/s: 4.6
    • Component/s: CiviContribute, CiviCRM API
    • Labels:
    • Documentation Required?:
      None

      Description

      Steps to reproduce:

      1. Create a new contribution in state "pending" with no transaction id (nominally via API or a BAO)
      2. Attempt to complete the contribution via API Contribution.create(id => *, trxn_id => *, contribution_status_id => [Completed status id], ...)

      Expected outcome:

      a. Contribution status and transaction id is updated.
      b. A financial transaction record is written with the relevant trxn_id

      Actual outcome:

      As expected but the trxn_id is NULL for part b.

      This results in missing transactions data on reports as the civicrm_financial_trxn record can't be joined into, eg. civicrm_contribution

        Attachments

          Activity

          [CRM-15958] Updating a contribution to completed with a new trxn_id writes unjoinable finanical_trxn record
          Agileware added a comment -

          This simple patch fixes the issue in question - the trxn_id seems to be overwritten by the original value for some comparison purposes

          David Greenberg added a comment -

          This should be considered for LTS.

          David Greenberg added a comment - - edited

          I reproduced this as well via the UI - updating a Pending contribution and adding a TRANSACTION ID - the trxn_id value is NOT written to financial_trxn table.

          https://github.com/civicrm/civicrm-core/pull/5209

            People

            • Assignee:
              David Greenberg
              Reporter:
              Agileware

              Dates

              • Created:
                Updated:
                Resolved: