From cbf4541b4ff8d4ae919ebd3f1e1fc2b4b65f8b0e Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 21 Nov 2023 13:07:16 +0100 Subject: [PATCH] ActionController::backend(): Add condition to check which backend should be used - If both are available --- library/Director/Web/Controller/ActionController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Director/Web/Controller/ActionController.php b/library/Director/Web/Controller/ActionController.php index 989292109..3a7ff77db 100644 --- a/library/Director/Web/Controller/ActionController.php +++ b/library/Director/Web/Controller/ActionController.php @@ -11,6 +11,7 @@ use Icinga\Module\Director\Integration\Icingadb\IcingadbBackend; use Icinga\Module\Director\Integration\BackendInterface; use Icinga\Module\Director\Integration\MonitoringModule\Monitoring; +use Icinga\Module\Director\ProvidedHook\Icingadb\IcingadbSupport; use Icinga\Module\Director\Web\Controller\Extension\CoreApi; use Icinga\Module\Director\Web\Controller\Extension\DirectorDb; use Icinga\Module\Director\Web\Controller\Extension\RestApi; @@ -255,7 +256,7 @@ protected function backend(): BackendInterface $modules->loadEnabledModules(); } - if ($modules->hasLoaded('icingadb')) { + if ($modules->hasLoaded('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) { $this->backend = new IcingadbBackend(); } else { $this->backend = new Monitoring();