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

CRM_Core_BAO_Financial_Trxn::getFinancialTrxnIds() assumes only one financial_trxn linked to a contribution record

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Accounting Integration
    • Labels:
      None

      Description

      While working on fix for CRM-11668, realized that CRM_Core_BAO_Financial_Trxn::getFinancialTrxnIds() which is used by several classes returns single INTEGER values for $ids['entityFinancialTrxnId'] and $ids['financialTrxnId']

      Given that most updates done to a contribution record will result in insertion of additional financial_trxn rows with entity_table = 'civicrm_contribution' - the query on line 132 will often return multiple rows. If we 'know' that we always want the first financial_trxn for the various classes which use this function - then we could just sort by ID ASC with LIMIT 1. Otherwise, please evaluate whether we should return an array of ID's - and update the classes which use this accordingly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dgg David Greenberg
                Reporter:
                dgg David Greenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: