mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Don't validate if not necessary - merged from branches/kiwiselect
This commit is contained in:
parent
6abbe5b44f
commit
69b5cd6686
@ -99,7 +99,7 @@ abstract class MultiForm extends Form {
|
|||||||
// Set up validation (if necessary) {@TODO find a better way instead
|
// Set up validation (if necessary) {@TODO find a better way instead
|
||||||
// of hardcoding a check for action_prev in order to prevent validation
|
// of hardcoding a check for action_prev in order to prevent validation
|
||||||
// when hitting the back button
|
// when hitting the back button
|
||||||
$validator = new Validator();
|
$validator = '';
|
||||||
if(empty($_REQUEST['action_prev'])) {
|
if(empty($_REQUEST['action_prev'])) {
|
||||||
if($this->getCurrentStep()->getValidator()) {
|
if($this->getCurrentStep()->getValidator()) {
|
||||||
$validator = $this->getCurrentStep()->getValidator();
|
$validator = $this->getCurrentStep()->getValidator();
|
||||||
@ -107,7 +107,7 @@ abstract class MultiForm extends Form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Give the fields, actions, and validation for the current step back to the parent Form class
|
// Give the fields, actions, and validation for the current step back to the parent Form class
|
||||||
parent::__construct($controller, $name, $fields, $actions, $validator);
|
parent::__construct($controller, $name, $fields, $actions, $validator ? $validator : null);
|
||||||
|
|
||||||
// Set the step returned above as the current step
|
// Set the step returned above as the current step
|
||||||
$this->setCurrentStep($currentStep);
|
$this->setCurrentStep($currentStep);
|
||||||
|
Loading…
Reference in New Issue
Block a user