parent
6258230fdb
commit
52e412002f
|
@ -116,7 +116,7 @@ class IcingaCommandArgumentForm extends DirectorObjectForm
|
||||||
$this->translate('The argument %s has successfully been stored'),
|
$this->translate('The argument %s has successfully been stored'),
|
||||||
$object->argument_name
|
$object->argument_name
|
||||||
);
|
);
|
||||||
$object->store($this->db);
|
$cmd->store($this->db);
|
||||||
} else {
|
} else {
|
||||||
$this->setHttpResponseCode(304);
|
$this->setHttpResponseCode(304);
|
||||||
$msg = $this->translate('No action taken, object has not been modified');
|
$msg = $this->translate('No action taken, object has not been modified');
|
||||||
|
|
|
@ -82,9 +82,16 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
|
||||||
|
|
||||||
public function set($key, $value)
|
public function set($key, $value)
|
||||||
{
|
{
|
||||||
$argument = IcingaCommandArgument::create(
|
if ($value instanceof IcingaCommandArgument) {
|
||||||
$this->mungeCommandArgument($key, $value)
|
$argument = $value;
|
||||||
)->set('command_id', $this->object->id);
|
} else {
|
||||||
|
$argument = IcingaCommandArgument::create(
|
||||||
|
$this->mungeCommandArgument($key, $value)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$argument->set('command_id', $this->object->id);
|
||||||
|
|
||||||
$key = $argument->argument_name;
|
$key = $argument->argument_name;
|
||||||
if (array_key_exists($key, $this->arguments)) {
|
if (array_key_exists($key, $this->arguments)) {
|
||||||
$this->arguments[$key]->replaceWith($argument);
|
$this->arguments[$key]->replaceWith($argument);
|
||||||
|
|
Loading…
Reference in New Issue