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