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

Handle smart groups created in previous Civis which include relation_permission #12804

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
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