mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
MINOR Fixing use of deprecated functions
This commit is contained in:
parent
9287dbb681
commit
c580887e21
@ -385,13 +385,13 @@ abstract class MultiForm extends Form {
|
|||||||
*/
|
*/
|
||||||
public function finish($data, $form) {
|
public function finish($data, $form) {
|
||||||
if(!$this->getCurrentStep()->isFinalStep()) {
|
if(!$this->getCurrentStep()->isFinalStep()) {
|
||||||
Director::redirectBack();
|
$this->controller->redirectBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->getCurrentStep()->validateStep($data, $form)) {
|
if(!$this->getCurrentStep()->validateStep($data, $form)) {
|
||||||
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
||||||
Director::redirectBack();
|
$this->controller->redirectBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,7 +418,7 @@ abstract class MultiForm extends Form {
|
|||||||
$nextStepClass = $this->getCurrentStep()->getNextStep();
|
$nextStepClass = $this->getCurrentStep()->getNextStep();
|
||||||
|
|
||||||
if(!$nextStepClass) {
|
if(!$nextStepClass) {
|
||||||
Director::redirectBack();
|
$this->controller->redirectBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ abstract class MultiForm extends Form {
|
|||||||
// so the form is re-populated.
|
// so the form is re-populated.
|
||||||
if(!$this->getCurrentStep()->validateStep($data, $form)) {
|
if(!$this->getCurrentStep()->validateStep($data, $form)) {
|
||||||
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
||||||
Director::redirectBack();
|
$this->controller->redirectBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,8 +442,7 @@ abstract class MultiForm extends Form {
|
|||||||
$this->setCurrentStep($nextStep);
|
$this->setCurrentStep($nextStep);
|
||||||
|
|
||||||
// Redirect to the next step
|
// Redirect to the next step
|
||||||
Director::redirect($nextStep->Link());
|
$this->controller->redirect($nextStep->Link());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -464,7 +463,7 @@ abstract class MultiForm extends Form {
|
|||||||
$prevStepClass = $this->getCurrentStep()->getPreviousStep();
|
$prevStepClass = $this->getCurrentStep()->getPreviousStep();
|
||||||
|
|
||||||
if(!$prevStepClass && !$this->getCurrentStep()->canGoBack()) {
|
if(!$prevStepClass && !$this->getCurrentStep()->canGoBack()) {
|
||||||
Director::redirectBack();
|
$this->controller->redirectBack();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,8 +474,7 @@ abstract class MultiForm extends Form {
|
|||||||
$this->setCurrentStep($prevStep);
|
$this->setCurrentStep($prevStep);
|
||||||
|
|
||||||
// Redirect to the previous step
|
// Redirect to the previous step
|
||||||
Director::redirect($prevStep->Link());
|
$this->controller->redirect($prevStep->Link());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user