From ac652f59668d7e84592f33cce3b32f746455ddf3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 28 May 2021 15:24:18 +0200 Subject: [PATCH] Basket: allow Notification Apply Rules export fixes #2335 --- application/controllers/NotificationController.php | 5 +++++ doc/82-Changelog.md | 1 + .../Director/DirectorObject/Automation/BasketSnapshot.php | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/controllers/NotificationController.php b/application/controllers/NotificationController.php index f43651f4..97fa0f4d 100644 --- a/application/controllers/NotificationController.php +++ b/application/controllers/NotificationController.php @@ -52,6 +52,11 @@ class NotificationController extends ObjectController } } + protected function hasBasketSupport() + { + return $this->object->isTemplate() || $this->object->isApplyRule(); + } + protected function loadObject() { if ($this->object === null) { diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index 97fd2133..61a2c2e9 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -16,6 +16,7 @@ next (will be 1.9.0) * FEATURE: there is now a simple "group by" Property Modifier (#2317) ### Configuration Baskets +* FIX: Notification Apply Rules have not been exported (#2335) * FEATURE: it's now possible to purge objects of specific types (#2201) ### Permissions and Restrictions diff --git a/library/Director/DirectorObject/Automation/BasketSnapshot.php b/library/Director/DirectorObject/Automation/BasketSnapshot.php index c73c7b94..44675e8e 100644 --- a/library/Director/DirectorObject/Automation/BasketSnapshot.php +++ b/library/Director/DirectorObject/Automation/BasketSnapshot.php @@ -41,7 +41,7 @@ class BasketSnapshot extends DbObject 'ServiceTemplate' => IcingaService::class, 'ServiceSet' => IcingaServiceSet::class, 'NotificationTemplate' => IcingaNotification::class, - 'Notification' => IcingaNotification::class, + 'Notification' => [IcingaNotification::class, ['object_type' => 'apply']], 'DataList' => DirectorDatalist::class, 'Dependency' => IcingaDependency::class, 'ImportSource' => ImportSource::class,