From 52521db8112d21a214ced7fadd3323908d2beefa Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Wed, 4 Dec 2024 09:57:03 +0000 Subject: [PATCH] fixup! better detection of MP related alerts for grouping --- classes/AlertView/Standard.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/AlertView/Standard.php b/classes/AlertView/Standard.php index 058f5cb880..8b4487ed89 100644 --- a/classes/AlertView/Standard.php +++ b/classes/AlertView/Standard.php @@ -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;