MINOR: Make the form reference consistently available on form steps.

This commit is contained in:
ajshort 2011-12-19 14:21:47 +11:00
parent c73082e2ab
commit 65d1681331
2 changed files with 4 additions and 0 deletions

View File

@ -199,6 +199,8 @@ abstract class MultiForm extends Form {
*/
protected function setCurrentStep($step) {
$this->session->CurrentStepID = $step->ID;
$step->setForm($this);
return $this->session->write();
}

View File

@ -263,6 +263,8 @@ class MultiFormStep extends DataObject {
$steps = DataObject::get('MultiFormStep', "\"SessionID\" = {$this->SessionID}", '"LastEdited" DESC');
if($steps) {
foreach($steps as $step) {
$step->setForm($this->form);
if($step->getNextStep()) {
if($step->getNextStep() == $this->class) {
return $step->class;