diff --git a/src/Models/MultiFormStep.php b/src/Models/MultiFormStep.php index 5b001b8..5dd96ad 100644 --- a/src/Models/MultiFormStep.php +++ b/src/Models/MultiFormStep.php @@ -308,7 +308,8 @@ class MultiFormStep extends DataObject */ public function getPreviousStep() { - $steps = DataObject::get(MultiFormStep::class, "\"SessionID\" = {$this->SessionID}", '"LastEdited" DESC'); + $steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC'); + if ($steps) { foreach ($steps as $step) { $step->setForm($this->form);