From 5407c4fe7c0c5c5735a4b8df369ba69e2623b463 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 26 Oct 2016 00:17:03 +0000 Subject: [PATCH] ObjectsController: template table for templates... ...but load the other one first to trick the autoloader --- application/tables/IcingaHostTemplateTable.php | 1 - library/Director/Web/Controller/ObjectsController.php | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/tables/IcingaHostTemplateTable.php b/application/tables/IcingaHostTemplateTable.php index d35a126c..0d01004a 100644 --- a/application/tables/IcingaHostTemplateTable.php +++ b/application/tables/IcingaHostTemplateTable.php @@ -4,7 +4,6 @@ namespace Icinga\Module\Director\Tables; use Icinga\Module\Director\Tables\IcingaHostTable; -require_once __DIR__ . '/IcingaHostTable.php'; class IcingaHostTemplateTable extends IcingaHostTable { protected $searchColumns = array( diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index 550f3185..9ea258b4 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -112,7 +112,10 @@ abstract class ObjectsController extends ActionController $table = 'icinga' . ucfirst($type); } elseif ($dummy->isTemplate()) { $this->getTabs()->activate('templates'); + // Trick the autoloader $table = 'icinga' . ucfirst($type); + $this->loadTable($table); + $table .= 'Template'; } else { $this->getTabs()->activate('objects'); $table = 'icinga' . ucfirst($type);