From 1b662ff9e1f536cbe6e43c88abacaf3a05e67df0 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 21 Jul 2008 05:22:06 +0000 Subject: [PATCH] BUGFIX $this->form wasn't accessible on MultiFormStep because it wasn't being set by MultiForm->__construct() early enough in the piece --- code/MultiForm.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/MultiForm.php b/code/MultiForm.php index 6ca10bf..473627e 100644 --- a/code/MultiForm.php +++ b/code/MultiForm.php @@ -90,6 +90,12 @@ abstract class MultiForm extends Form { // step or creates a new one if none available) $currentStep = $this->getCurrentStep(); + // Set the step returned above as the current step + $this->setCurrentStep($currentStep); + + // Set the form of the step to this form instance + $currentStep->form = $this; + // Set up the fields for the current step $fields = $currentStep->getFields(); @@ -108,13 +114,7 @@ abstract class MultiForm extends Form { // Give the fields, actions, and validation for the current step back to the parent Form class parent::__construct($controller, $name, $fields, $actions, $validator ? $validator : null); - - // Set the step returned above as the current step - $this->setCurrentStep($currentStep); - // Set the form of the step to this form instance - $currentStep->form = $this; - // Set a hidden field in the form to identify this session. // Depending on what has been configured for $url_type, we // find an encrypted hash by default to identify the session.