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

Upgrade to 4.7.9 fails if no "Member Dues" or "Event Fee" financial type

    Details

    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      An upgrade step added for https://issues.civicrm.org/jira/browse/CRM-16189 adds civicrm_entity_financial_account records relating deferred revenue financial accounts to financial types named "Member Dues" and "Event Fee".

      If one of those names matches no financial types on your site, however, the upgrade fails with a constraint violation. This is even the case if you have simply renamed one of those financial types.

      The specific problem is that "@financial_type_id_md" (or "..._ef") is null when the type can't be found, and then the row to be inserted in civicrm_entity_financial_account has a null value for the entity_id, which isn't allowed.

      However, I think this is symptomatic of a bigger issue. This could fail in a bunch of ways:

      • someone deletes the financial type because they don't have memberships
      • someone translates the name
      • someone calls their members "partners" and has "partner dues"
      • even if someone adds a character (e.g. "Event Fees") or capitalization change, it won't match

      Meanwhile, if someone uses events or memberships heavily, they might have additional financial types that wouldn't be covered.

      Some conversation on the PR that included this (https://github.com/civicrm/civicrm-core/pull/8561) covered whether those names are translatable. In the case of the site I'm upgrading, the member dues account exists and was just renamed.

      I figure Joe Murray, Pradeep Nayak, and Yashodha Chaku will know best how to proceed. Maybe it's simply not adding the row if there's no account that's missing. Alternatively, if it's this important that these financial types get deferred revenue accounts, it would be important to handle any additional membership- and event-related financial types.

      I suspect that an important part of any resolution would be an upgrade message telling people about reviewing the deferred revenue accounts for their financial types.

      (In the meantime, for any end users stumbling upon this, a quick hack to fix this is to create or rename financial accounts so that there are accounts named exactly "Member Dues" and "Event Fee".)

        Attachments

          Activity

            People

            • Assignee:
              pradeep.nayak Pradeep Nayak
              Reporter:
              andrewhunt Andrew Hunt
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: