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

Renamed Contact Types Cause "Invalid Entity Filter" Exception

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 4.7.7
    • Fix Version/s: 4.7.8
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Contributed Code

      Description

      Commit https://github.com/civicrm/civicrm-core/commit/79363422d47677e58596798ed26304c8c4b9953c by eileenmcnaughton on April 21st added new code to check contactTypes.

      This causes an issue if you have renamed any of your contact types. If you try to open a contact you will get an error that says: Invalid Entity Filter

      Line 656 of /CRM/Core/BAO/CustomGroup.php is:

      if ($entityType != 'Contact' && !in_array($entityType, $contactTypes['values'])) {

      The issue is we need to be checking the keys, not the values. I believe the corrected code should be:

      if ($entityType != 'Contact' && !array_key_exists($entityType, $contactTypes['values'])) {

      Attached is the patch file.

        Attachments

          Activity

            People

            • Assignee:
              yashodha Yashodha Chaku
              Reporter:
              mmitchell Micah Mitchell
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: