From f1dd69d8777ec1dae01e48a89f2e8a01a8f33087 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 7 Dec 2020 16:00:27 +0100 Subject: [PATCH] ActionController: Set autorefresh interval on view as late as possible This allows to initialize property `$autorefreshInterval` and have it take an effect on non-XHR requests. --- library/Icinga/Web/Controller/ActionController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 80d00d9bd..039f51db3 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -356,14 +356,14 @@ class ActionController extends Zend_Controller_Action } $this->autorefreshInterval = $interval; - $this->_helper->layout()->autorefreshInterval = $interval; + return $this; } public function disableAutoRefresh() { $this->autorefreshInterval = null; - $this->_helper->layout()->autorefreshInterval = null; + return $this; } @@ -480,6 +480,10 @@ class ActionController extends Zend_Controller_Action } } + if ($this->autorefreshInterval !== null) { + $layout->autorefreshInterval = $this->autorefreshInterval; + } + if ($req->getParam('error_handler') === null && $req->getParam('format') === 'pdf') { $this->sendAsPdf(); $this->shutdownSession();