Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix customGroup getTableNameByEntityName to recognize all entities #18546

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 3 additions & 40 deletions CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down