ObjectController: Use objects table name to search history

This was mainly a problem for IcingaServiceSet and others that may have
a capital letter where the table name is split by `_`
This commit is contained in:
Markus Frosch 2019-04-10 10:39:05 +02:00
parent cd9d93de3e
commit db00f1bfc4

View File

@ -234,10 +234,10 @@ abstract class ObjectController extends ActionController
$this->addTitle($this->translate('Activity Log: %s'), $name); $this->addTitle($this->translate('Activity Log: %s'), $name);
$db = $this->db(); $db = $this->db();
$type = $this->getType(); $objectTable = $this->object->getTableName();
$table = (new ActivityLogTable($db)) $table = (new ActivityLogTable($db))
->setLastDeployedId($db->getLastDeploymentActivityLogId()) ->setLastDeployedId($db->getLastDeploymentActivityLogId())
->filterObject('icinga_' . $type, $name); ->filterObject($objectTable, $name);
if ($host = $this->params->get('host')) { if ($host = $this->params->get('host')) {
$table->filterHost($host); $table->filterHost($host);
} }