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

Issue #3420102: Remove references to public_group, open_group, closed_group, and secret_group for activity_viewer module #3777

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,14 @@ public function query(): void {
$query = $this->query;
$account = $this->view->getUser();

$open_groups = [];
$group_memberships = [];
if ($this->moduleHandler->moduleExists('social_group')) {
// @todo This creates a dependency on Social Group which shouldn't exist,
// this access logic should be in that module instead.
$open_groups = social_group_get_all_open_groups();
$group_memberships = $this->groupHelper
->getAllGroupsForUser($account->id());
}
$groups = array_merge($open_groups, $group_memberships);
$groups_unique = array_unique($groups);

$groups_unique = array_unique($group_memberships ?? []);

// Add tables and joins.
$query->addTable('activity__field_activity_recipient_group');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,16 @@ public function canExpose(): bool {
public function query():void {
$account = $this->view->getUser();

$open_groups = [];
$public_groups = [];
$group_memberships = [];

if ($this->moduleHandler->moduleExists('social_group')) {
// @todo This creates a dependency on Social Group which shouldn't exist,
// this access logic should be in that module instead.
$open_groups = social_group_get_all_open_groups();
$public_groups = social_group_get_all_public_groups();
$group_memberships = $this->groupHelper->getAllGroupsForUser($account->id());
}

$groups = [
...$open_groups,
...$public_groups,
...$group_memberships,
...$group_memberships ?? [],
];

$groups_unique = array_unique($groups);

// Add tables and joins.
Expand Down
Loading