RestoreObjectForm: Handle restore for all apply rules in object_type apply

This commit is contained in:
Markus Frosch 2018-08-10 13:58:01 +02:00
parent 679539d5dd
commit a1a0939909
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,6 @@ namespace Icinga\Module\Director\Forms;
use Icinga\Exception\NotFoundError;
use Icinga\Exception\NotImplementedError;
use Icinga\Module\Director\Objects\IcingaObject;
use Icinga\Module\Director\Objects\IcingaService;
use Icinga\Module\Director\Web\Form\DirectorForm;
class RestoreObjectForm extends DirectorForm
@ -26,7 +25,8 @@ class RestoreObjectForm extends DirectorForm
$keyParams = $object->getKeyParams();
if ($object instanceof IcingaService && $object->isApplyRule()) {
if ($object->supportsApplyRules() && $object->get('object_type') === 'apply') {
// TODO: not all apply should be considered unique by name + object_type
$query = $db->getDbAdapter()
->select()
->from($object->getTableName())