IcingaObject: improve type detection

fixes #12319
This commit is contained in:
Thomas Gelf 2016-08-09 14:17:57 +00:00
parent 50c67ceda2
commit e639790d52
2 changed files with 2 additions and 2 deletions

View File

@ -322,7 +322,7 @@ class ObjectCommand extends Command
protected function load($name)
{
return IcingaObject::loadByType(
lcfirst($this->getType()),
$this->getType(),
$name,
$this->db()
);

View File

@ -1705,7 +1705,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
protected static function classByType($type)
{
// allow for icinga_host and host
$type = preg_replace('/^icinga_/', '', $type);
$type = lcfirst(preg_replace('/^icinga_/', '', $type));
if (strpos($type, 'data') === false) {
$prefix = 'Icinga';