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

Incremental upgrade 4.3.4 fails if no COGS and EXP default account set

    Details

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

      Description

      If you don't have a default "Cost of Sales" and "Expenses" account, the incremental upgrade will fail with a constraint violation:

      nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`civicrm`.`civicrm_entity_financial_account`, CONSTRAINT `FK_civicrm_entity_financial_account_financial_account_id` FOREIGN KEY (`financial_account_id`) REFERENCES `civicrm_financial_account` )
      

      The reason is, that in this case 4.3.4.mysql.tpl#L76 (and 4.3.4.mysql.tpl#L88 respectively) don't return a valid financialAccountId.

      To reproduce this issue, it should be enough to remove all default accounts on pre 3.4.4 and then try an upgrade.

      Issue observed while upgrading from 4.3.1 to 4.3.5.

        Attachments

          Activity

            People

            • Assignee:
              dgg David Greenberg
              Reporter:
              b.systopia Björn Endres
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: