mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Disable partial validation of forms by default
This commit is contained in:
parent
38ef33276a
commit
760bf1a020
@ -101,6 +101,13 @@ class Form extends Zend_Form
|
||||
*/
|
||||
protected $uidElementName = 'formUID';
|
||||
|
||||
/**
|
||||
* Whether the form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $validatePartial = false;
|
||||
|
||||
/**
|
||||
* Default element decorators
|
||||
*
|
||||
@ -333,6 +340,29 @@ class Form extends Zend_Form
|
||||
return $this->uidElementName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether this form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setValidatePartial($state)
|
||||
{
|
||||
$this->validatePartial = $state;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether this form should validate the sent data when being automatically submitted
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getValidatePartial()
|
||||
{
|
||||
return $this->validatePartial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create this form
|
||||
*
|
||||
@ -580,8 +610,8 @@ class Form extends Zend_Form
|
||||
|| ($this->onSuccess === null && false !== $this->onSuccess()))) {
|
||||
$this->getResponse()->redirectAndExit($this->getRedirectUrl());
|
||||
}
|
||||
} else {
|
||||
// The form can't be processed but we want to show validation errors though
|
||||
} elseif ($this->getValidatePartial()) {
|
||||
// The form can't be processed but we may want to show validation errors though
|
||||
$this->isValidPartial($formData);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user