mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Fix dis/enabling of feature commands of multi-selected hosts or services.
In case of elements other than CheckboxElement $element->getValue() must be used instead of $element->isChecked().
This commit is contained in:
parent
13669fd1ae
commit
2a2ac29589
1 changed files with 6 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ use Icinga\Module\Icingadb\Command\Object\ToggleObjectFeatureCommand;
|
|||
use Icinga\Module\Icingadb\Common\Auth;
|
||||
use Icinga\Module\Icingadb\Forms\Command\CommandForm;
|
||||
use Icinga\Web\Notification;
|
||||
use ipl\Html\FormElement\CheckboxElement;
|
||||
use ipl\Orm\Model;
|
||||
use ipl\Web\FormDecorator\IcingaFormDecorator;
|
||||
|
||||
|
|
@ -160,7 +161,11 @@ class ToggleObjectFeaturesForm extends CommandForm
|
|||
protected function getCommand(Model $object): \Generator
|
||||
{
|
||||
foreach ($this->features as $feature => $spec) {
|
||||
$featureState = $this->getElement($feature)->isChecked();
|
||||
if ($this->getElement($feature) instanceof CheckboxElement) {
|
||||
$featureState = $this->getElement($feature)->isChecked();
|
||||
} else {
|
||||
$featureState = $this->getElement($feature)->getValue();
|
||||
}
|
||||
|
||||
if (
|
||||
! $this->isGrantedOn($spec['permission'], $object)
|
||||
|
|
|
|||
Loading…
Reference in a new issue