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 #17 from GinkgoFJG/fix-array_flip-warning
Browse files Browse the repository at this point in the history
Replaced array_flip() with array_keys() to avoid PHP warnings in some edge cases.
  • Loading branch information
eileenmcnaughton authored Jan 27, 2018
2 parents e0246dc + 79e88f9 commit 6a94df2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions multisite.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function multisite_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups,
$groupID = _multisite_get_domain_group();
// If multisite is not enabled, or if a domain group is not selected, then we default to all groups allowed
if (!$isEnabled || !$groupID) {
$currentGroups = array_flip($allGroups);
$currentGroups = array_keys($allGroups);
return;
}
if (!CRM_Core_Permission::check('list all groups in domain') && !_multisite_add_permissions($type)) {
Expand All @@ -195,7 +195,7 @@ function multisite_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups,
//all groups is empty if we really mean all groups but if a filter like 'is_disabled' is already applied
// it is populated, ajax calls from Manage Groups will leave empty but calls from New Mailing pass in a filtered list
$originalCurrentGroups = $currentGroups;
$currentGroups = array_intersect($currentGroups, array_flip($allGroups));
$currentGroups = array_intersect($currentGroups, array_keys($allGroups));
$currentGroups = array_merge($currentGroups, array_intersect($originalCurrentGroups, $disabledGroups));
}
}
Expand Down

0 comments on commit 6a94df2

Please sign in to comment.