From 1e1dca2ffadf7586bb705fe59d6261f105bf0ba8 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Fri, 11 Jul 2025 16:20:41 +0200 Subject: [PATCH] Adjust the usage of the relation name accordingly --- application/controllers/EventController.php | 2 +- application/controllers/HistoryController.php | 2 +- library/Icingadb/View/EventRenderer.php | 16 ++++++++-------- library/Icingadb/Widget/Detail/EventDetail.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php index ae325621..c7a20749 100644 --- a/application/controllers/EventController.php +++ b/application/controllers/EventController.php @@ -40,7 +40,7 @@ class EventController extends Controller 'downtime.triggered_by.service', 'downtime.triggered_by.service.state', 'flapping', - 'notification', + 'notification_history', 'acknowledgement', 'state' ]) diff --git a/application/controllers/HistoryController.php b/application/controllers/HistoryController.php index 08a96889..83a11de8 100644 --- a/application/controllers/HistoryController.php +++ b/application/controllers/HistoryController.php @@ -38,7 +38,7 @@ class HistoryController extends Controller 'comment', 'downtime', 'flapping', - 'notification', + 'notification_history', 'acknowledgement', 'state' ]); diff --git a/library/Icingadb/View/EventRenderer.php b/library/Icingadb/View/EventRenderer.php index af900b3c..e24a7a3f 100644 --- a/library/Icingadb/View/EventRenderer.php +++ b/library/Icingadb/View/EventRenderer.php @@ -176,12 +176,12 @@ class EventRenderer implements ItemRenderer public function assembleTitle($item, HtmlDocument $title, string $layout): void { - if ($item->event_type === 'notification' && isset($item->notification->id)) { - $item->notification->history = $item; - $item->notification->host = $item->host; - $item->notification->service = $item->service; + if ($item->event_type === 'notification' && isset($item->notification_history->id)) { + $item->notification_history->history = $item; + $item->notification_history->host = $item->host; + $item->notification_history->service = $item->service; - $this->notificationRenderer->assembleTitle($item->notification, $title, $layout); + $this->notificationRenderer->assembleTitle($item->notification_history, $title, $layout); return; } @@ -304,10 +304,10 @@ class EventRenderer implements ItemRenderer public function assembleCaption($item, HtmlDocument $caption, string $layout): void { if ($item->event_type === 'notification') { - $item->notification->host = $item->host; - $item->notification->service = $item->service; + $item->notification_history->host = $item->host; + $item->notification_history->service = $item->service; - $this->notificationRenderer->assembleCaption($item->notification, $caption, $layout); + $this->notificationRenderer->assembleCaption($item->notification_history, $caption, $layout); return; } diff --git a/library/Icingadb/Widget/Detail/EventDetail.php b/library/Icingadb/Widget/Detail/EventDetail.php index 70ad21a5..8e2dc73e 100644 --- a/library/Icingadb/Widget/Detail/EventDetail.php +++ b/library/Icingadb/Widget/Detail/EventDetail.php @@ -651,7 +651,7 @@ class EventDetail extends BaseHtmlElement { switch ($this->event->event_type) { case 'notification': - $this->assembleNotificationEvent($this->event->notification); + $this->assembleNotificationEvent($this->event->notification_history); break; case 'state_change':