Skip to content

Commit

Permalink
fixup! better detection of MP related alerts for grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Dec 4, 2024
1 parent 52b971f commit 52521db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions classes/AlertView/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,14 @@ protected function setUserData() {
$add = false;
$this->data['all_keywords'][] = $term;
$this->data['own_member_alerts'][] = $alert;
} elseif (\MySociety\TheyWorkForYou\Utility\Search::searchMemberDbLookupWithNames($term)) {
if (!array_key_exists($term, $this->data['spoken_alerts'])) {
$this->data['spoken_alerts'][$term] = [];
}
$add = false;
# need to add this to make it consistent so the front end know where to get the name
$alert['spokenby'] = [$term];
$this->data['spoken_alerts'][$term][] = $alert;
}
if ($add) {
$this->data['all_keywords'][] = $term;
Expand Down

0 comments on commit 52521db

Please sign in to comment.