mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
BUGFIX: Fixed the form state not being saved to the session after a custom validateStep() validation failure.
This commit is contained in:
parent
9816df1538
commit
1f1bb225f0
@ -403,8 +403,11 @@ abstract class MultiForm extends Form {
|
||||
return false;
|
||||
}
|
||||
|
||||
// custom validation (use MultiFormStep->getValidator() for built-in functionality)
|
||||
// Perform custom step validation (use MultiFormStep->getValidator() for
|
||||
// built-in functionality). The data needs to be manually saved on error
|
||||
// so the form is re-populated.
|
||||
if(!$this->getCurrentStep()->validateStep($data, $form)) {
|
||||
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
||||
Director::redirectBack();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user