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

Fix: Group alert banner query alteration #316

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
11 changes: 7 additions & 4 deletions modules/group_alert_banner/group_alert_banner.module
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ function group_alert_banner_query_entity_query_alter(AlterableInterface $query)
// The 'gcfd' table alias is set in
// Drupal\group\QueryAccess\EntityQueryAlter::doAlter() for the
// group_relationship_field_data table.
$query->where(
"(gcfd.entity_id IS NOT NULL AND gcfd.gid = :gid) OR gcfd.entity_id IS NULL",
[':gid' => $gid]
);
$table_aliases = $query->getTables();
if (array_key_exists('gcfd', $table_aliases)) {
$query->where(
'(gcfd.entity_id IS NOT NULL AND gcfd.gid = :gid) OR gcfd.entity_id IS NULL',
[':gid' => $gid]
);
}
}

/**
Expand Down
Loading