mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ObjectController: fail when loading twice
This commit is contained in:
parent
f0deb11e7f
commit
7c553257a6
@ -6,6 +6,7 @@ use gipfl\Web\Widget\Hint;
|
|||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
use Icinga\Exception\InvalidPropertyException;
|
use Icinga\Exception\InvalidPropertyException;
|
||||||
use Icinga\Exception\NotFoundError;
|
use Icinga\Exception\NotFoundError;
|
||||||
|
use Icinga\Exception\ProgrammingError;
|
||||||
use Icinga\Module\Director\Deployment\DeploymentInfo;
|
use Icinga\Module\Director\Deployment\DeploymentInfo;
|
||||||
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
|
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
|
||||||
use Icinga\Module\Director\Exception\NestingError;
|
use Icinga\Module\Director\Exception\NestingError;
|
||||||
@ -452,6 +453,9 @@ abstract class ObjectController extends ActionController
|
|||||||
|
|
||||||
protected function loadObject()
|
protected function loadObject()
|
||||||
{
|
{
|
||||||
|
if ($this->object) {
|
||||||
|
throw new ProgrammingError('Loading an object twice is not very efficient');
|
||||||
|
}
|
||||||
if ($this->object === null) {
|
if ($this->object === null) {
|
||||||
if ($id = $this->params->get('id')) {
|
if ($id = $this->params->get('id')) {
|
||||||
$this->object = IcingaObject::loadByType(
|
$this->object = IcingaObject::loadByType(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user