From 12a818216c78ddbcb37ae470ca3c777d179f3f6a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 30 Nov 2020 08:11:25 +0100 Subject: [PATCH] IcingaNotification: separate times.begin/end fixes #2193 --- doc/82-Changelog.md | 1 + .../Director/Objects/IcingaNotification.php | 33 ++----------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index 903a75f8..0562723b 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -74,6 +74,7 @@ next (will be 1.8.0) ### Icinga Configuration * FIX: Correctly render Service Dependencies with Array-style parent hosts (#2088) +* FIX: times.begin and times.end are now rendered separately (#2193) * REMOVED: magic-apply-for (a hidden deprecated feature) has been removed (#1851) ### Icinga Agent handling diff --git a/library/Director/Objects/IcingaNotification.php b/library/Director/Objects/IcingaNotification.php index e4182232..d64fde7d 100644 --- a/library/Director/Objects/IcingaNotification.php +++ b/library/Director/Objects/IcingaNotification.php @@ -69,52 +69,23 @@ class IcingaNotification extends IcingaObject implements ExportInterface } /** - * We have distinct properties in the db - * - * ...but render times only once - * - * And we skip warnings about underscores in method names: * @codingStandardsIgnoreStart - * * @return string */ protected function renderTimes_begin() { // @codingStandardsIgnoreEnd - $times = (object) [ - 'begin' => c::renderInterval($this->times_begin) - ]; - - if ($this->get('times_end') !== null) { - $times->end = c::renderInterval($this->get('times_end')); - } - - return c::renderKeyValue('times', c::renderDictionary($times)); + return c::renderKeyValue('times.begin', c::renderInterval($this->get('times_begin'))); } /** - * We have distinct properties in the db - * - * ...but render times only once - * - * And we skip warnings about underscores in method names: * @codingStandardsIgnoreStart - * * @return string */ protected function renderTimes_end() { // @codingStandardsIgnoreEnd - - if ($this->get('times_begin') !== null) { - return ''; - } - - $times = (object) [ - 'end' => c::renderInterval($this->get('times_end')) - ]; - - return c::renderKeyValue('times', c::renderDictionary($times)); + return c::renderKeyValue('times.end', c::renderInterval($this->get('times_end'))); } public function getUniqueIdentifier()