mirror of
https://github.com/silverstripe/silverstripe-multiform
synced 2024-10-22 11:05:49 +02:00
Add check if current step doesn't exist and no session current step then get the current step
This commit is contained in:
parent
a57bfe74bb
commit
2574126d1f
@ -229,14 +229,14 @@ abstract class MultiForm extends Form
|
|||||||
$currentStep = null;
|
$currentStep = null;
|
||||||
$StepID = $this->controller->getRequest()->getVar('StepID');
|
$StepID = $this->controller->getRequest()->getVar('StepID');
|
||||||
if (isset($StepID)) {
|
if (isset($StepID)) {
|
||||||
$currentStep = DataObject::get_one(
|
$currentStep = MultiFormStep::get()->filter([
|
||||||
MultiFormStep::class,
|
'SessionID' => $this->session->ID,
|
||||||
[
|
'ID' => $StepID
|
||||||
'SessionID' => $this->session->ID,
|
])->first();
|
||||||
'ID' => $StepID
|
}
|
||||||
]
|
|
||||||
);
|
// if current step doesn't exist and no session current step then get the current step
|
||||||
} elseif ($this->session->CurrentStepID) {
|
if (!$currentStep && $this->session->CurrentStepID) {
|
||||||
$currentStep = $this->session->CurrentStep();
|
$currentStep = $this->session->CurrentStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user