Skip to content

Commit

Permalink
Merge pull request #12804 from highfalutin/CORE-390-relation_permissi…
Browse files Browse the repository at this point in the history
…on-search-5.6

Handle smart groups created in previous Civis which include relation_permission
  • Loading branch information
eileenmcnaughton authored Sep 12, 2018
2 parents 05fdc0f + f85f95b commit 78d330f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4231,6 +4231,10 @@ public function relationship(&$values) {
public function addRelationshipPermissionClauses($grouping, &$where) {
$relPermission = $this->getWhereValues('relation_permission', $grouping);
if ($relPermission) {
if (!is_array($relPermission[2])) {
// this form value was scalar in previous versions of Civi
$relPermission[2] = array($relPermission[2]);
}
$where[$grouping][] = "(civicrm_relationship.is_permission_a_b IN (" . implode(",", $relPermission[2]) . "))";

$allRelationshipPermissions = CRM_Contact_BAO_Relationship::buildOptions('is_permission_a_b');
Expand Down

0 comments on commit 78d330f

Please sign in to comment.