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

Fatal SQL error when completing a partially paid contribution in localized installation

    Details

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

      Description

      To reproduce :

      • have a CiviCRM localized with translated financial status (civicrm/admin/options)
      • have a partially paid contribution
      • record a new payment with the remaining amount required to complete the payment

      The system will crash with DB Error: syntax error

      Clearly the status_id was not found :

      UPDATE civicrm_financial_item fi LEFT JOIN civicrm_entity_financial_trxn eft ON (eft.entity_id = fi.id AND eft.entity_table = 'civicrm_financial_item') SET status_id = WHERE eft.financial_trxn_id IN (101, 101) 

      In the code, we have :

      $financialItemStatus = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_FinancialItem', 'status_id');
       $paidStatus = array_search('Paid', $financialItemStatus);

       

      I'm not even sure if the financial status appear anywhere on the screen for the end user (reports ?) but nothing forbid to do it in the UI (civicrm/admin/options) and it's a bad idea in the code to compare a value that might be translated.

       

       

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              samuelsov Samuel Vanhove
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: