Merge pull request #79 from isobar-nz/fix-session-current-step

Fix get current step
This commit is contained in:
Damian Mooyman 2019-11-29 12:29:02 +13:00 committed by GitHub
commit 41d8927602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,
[
$currentStep = MultiFormStep::get()->filter([
'SessionID' => $this->session->ID,
'ID' => $StepID
]
);
} elseif ($this->session->CurrentStepID) {
])->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();
}