Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #24 from eileenmcnaughton/dev_core_1450
Browse files Browse the repository at this point in the history
dev/core#1450 Allow sites to opt out of using temporary tables when b…
  • Loading branch information
eileenmcnaughton authored Mar 20, 2020
2 parents f827b5d + 074f017 commit 2d8eb99
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ function multisite_civicrm_aclWhereClause($type, &$tables, &$whereTables, &$cont
return;
}
$childOrganizations = _multisite_get_all_child_groups($groupID);
// We have view all contacts in domain or edit all contacts in domain so lets not use a temporary table.
if ((CRM_Core_Permission::check('view all contacts in domain') || CRM_Core_Permission::check('edit all contacts in domain')) && Civi::Settings()->get('multisite_not_use_temp_table')) {
CRM_Contact_BAO_Contact_Permission::setUseTemporaryTable(FALSE);
}
if (!empty($childOrganizations)) {
$groupTable = 'civicrm_group_contact';
$groupTableAlias = 'multisiteGroupTable';
Expand Down
16 changes: 14 additions & 2 deletions settings/Multisite.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,17 @@
'is_contact' => 0,
'description' => 'Array of tabs which should be visible on this site',
'help_text' => 'Enabled Custom Tabs',
),
);
),
'multisite_not_use_temp_table' => [
'group_name' => 'Multi Site Preferences',
'group' => 'multisite',
'name' => 'multisite_not_use_temp_table',
'type' => 'Boolean',
'default' => 0,
'add' => '5.20',
'is_domain' => 1,
'is_contact' => 0,
'description' => 'Should we disable the use of temporary tables when building ACL permissions for roles with view all contacts in domain or edit all contacts in domain',
'html' => 'Checkbox',
],
);

0 comments on commit 2d8eb99

Please sign in to comment.