From c9eaf5decbe7fab4716eef97553f99c048842d0e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 21 Sep 2020 14:20:10 -0400 Subject: [PATCH] Fix customGroup getTableNameByEntityName to recognize all entities --- CRM/Core/BAO/CustomGroup.php | 43 +++--------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 3a0dac33f161..52a96839fb92 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1121,53 +1121,16 @@ public static function &getActiveGroups($entityType, $path, $cidToken = '%%cid%% * @see _apachesolr_civiAttachments_dereference_file_parent */ public static function getTableNameByEntityName($entityType) { - $tableName = ''; switch ($entityType) { case 'Contact': case 'Individual': case 'Household': case 'Organization': - $tableName = 'civicrm_contact'; - break; - - case 'Contribution': - $tableName = 'civicrm_contribution'; - break; - - case 'Group': - $tableName = 'civicrm_group'; - break; - - // DRAFTING: Verify if we cannot make it pluggable - - case 'Activity': - $tableName = 'civicrm_activity'; - break; - - case 'Relationship': - $tableName = 'civicrm_relationship'; - break; - - case 'Membership': - $tableName = 'civicrm_membership'; - break; - - case 'Participant': - $tableName = 'civicrm_participant'; - break; - - case 'Event': - $tableName = 'civicrm_event'; - break; - - case 'Grant': - $tableName = 'civicrm_grant'; - break; + return 'civicrm_contact'; - // need to add cases for Location, Address + default: + return CRM_Core_DAO_AllCoreTables::getTableForEntityName($entityType); } - - return $tableName; } /**