Skip to content

Commit

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

Handle smart groups created in previous Civi's which include relation_permission
  • Loading branch information
totten authored Sep 12, 2018
2 parents 0f32310 + 7f33f79 commit f185d91
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 @@ -4222,6 +4222,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 f185d91

Please sign in to comment.