From 249e7ca0d1d7e342f00ceb354ef4846e0548543b Mon Sep 17 00:00:00 2001 From: John Milmine Date: Mon, 29 Feb 2016 16:11:47 +1300 Subject: [PATCH] fixes late extensions binding Construct adds extensions, so calling functions which have extend calls in them before the parent:constructor means the extend calls will never find any extensions. --- code/forms/UserForm.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/forms/UserForm.php b/code/forms/UserForm.php index 110d27b..cd1f38c 100644 --- a/code/forms/UserForm.php +++ b/code/forms/UserForm.php @@ -17,11 +17,14 @@ class UserForm extends Form { parent::__construct( $controller, $name, - $this->getFormFields(), - $this->getFormActions(), - $this->getRequiredFields() + new FieldList(), + new FieldList() ); + $this->setFields($this->getFormFields()); + $this->setActions($this->getFormActions()); + $this->setValidator($this->getRequiredFields()); + // Number each page $stepNumber = 1; foreach($this->getSteps() as $step) {