mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
NavigationItem: fall back to the default renderer if an error occurrs
fixes #10486
This commit is contained in:
parent
d0cd03f324
commit
eecd15ee68
@ -7,6 +7,7 @@ use Exception;
|
|||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use IteratorAggregate;
|
use IteratorAggregate;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
|
use Icinga\Application\Logger;
|
||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
use Icinga\Exception\ProgrammingError;
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Web\Navigation\Renderer\NavigationItemRenderer;
|
use Icinga\Web\Navigation\Renderer\NavigationItemRenderer;
|
||||||
@ -815,7 +816,20 @@ class NavigationItem implements IteratorAggregate
|
|||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
return $this->getRenderer()->setItem($this)->render();
|
return $this->getRenderer()->setItem($this)->render();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Logger::error(
|
||||||
|
'Could not invoke custom navigation item renderer. %s in %s:%d with message: %s',
|
||||||
|
get_class($e),
|
||||||
|
$e->getFile(),
|
||||||
|
$e->getLine(),
|
||||||
|
$e->getMessage()
|
||||||
|
);
|
||||||
|
|
||||||
|
$renderer = new NavigationItemRenderer();
|
||||||
|
return $renderer->render($this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user