Adjust the usage of the relation name accordingly

This commit is contained in:
Sukhwinder Dhillon 2025-07-11 16:20:41 +02:00
parent 0d3440c285
commit 1e1dca2ffa
4 changed files with 11 additions and 11 deletions

View file

@ -40,7 +40,7 @@ class EventController extends Controller
'downtime.triggered_by.service',
'downtime.triggered_by.service.state',
'flapping',
'notification',
'notification_history',
'acknowledgement',
'state'
])

View file

@ -38,7 +38,7 @@ class HistoryController extends Controller
'comment',
'downtime',
'flapping',
'notification',
'notification_history',
'acknowledgement',
'state'
]);

View file

@ -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;
}

View file

@ -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':