Skip to content

Commit

Permalink
Merge pull request #79 from isobar-nz/fix-session-current-step
Browse files Browse the repository at this point in the history
Fix get current step
  • Loading branch information
tractorcow authored Nov 28, 2019
2 parents a57bfe7 + 2574126 commit 41d8927
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Forms/MultiForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,14 +229,14 @@ public function getCurrentStep()
$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();
}

Expand Down

0 comments on commit 41d8927

Please sign in to comment.