diff --git a/classes/AlertView/Standard.php b/classes/AlertView/Standard.php index 2659851275..058f5cb880 100644 --- a/classes/AlertView/Standard.php +++ b/classes/AlertView/Standard.php @@ -611,8 +611,24 @@ protected function setUserData() { $this->data['spoken_alerts'][$alert['spokenby'][0]] = []; } $this->data['spoken_alerts'][$alert['spokenby'][0]][] = $alert; - } else { - $this->data['all_keywords'][] = implode(' ', $alert['words']); + } + } + foreach ($this->data['alerts'] as $alert) { + $term = implode(' ', $alert['words']); + $add = true; + if (array_key_exists('spokenby', $alert)) { + $add = false; + } elseif (array_key_exists($term, $this->data['spoken_alerts'])) { + $add = false; + $this->data['all_keywords'][] = $term; + $this->data['spoken_alerts'][$term][] = $alert; + } elseif ($term == $own_mp_criteria) { + $add = false; + $this->data['all_keywords'][] = $term; + $this->data['own_member_alerts'][] = $alert; + } + if ($add) { + $this->data['all_keywords'][] = $term; $this->data['keyword_alerts'][] = $alert; } } diff --git a/www/includes/easyparliament/templates/html/alert/_list_accordian.php b/www/includes/easyparliament/templates/html/alert/_list_accordian.php index 115f927cd7..3c3e593255 100644 --- a/www/includes/easyparliament/templates/html/alert/_list_accordian.php +++ b/www/includes/easyparliament/templates/html/alert/_list_accordian.php @@ -212,9 +212,9 @@ -
Alert when = _htmlspecialchars(implode(', ', $alert['spokenby'])) ?> is mentioned
+Alert when = _htmlspecialchars(implode(', ', $person_alerts[0]['spokenby'])) ?> is mentioned