diff --git a/code/OpauthRegisterForm.php b/code/OpauthRegisterForm.php index c5fa48a..27f12f5 100644 --- a/code/OpauthRegisterForm.php +++ b/code/OpauthRegisterForm.php @@ -27,6 +27,9 @@ public function __construct($controller, $name, array $requiredFields = null) { $this->requiredFields = $requiredFields; } parent::__construct($controller, $name, $this->getFields(), $this->getActions(), $this->getValidator()); + // Manually call extensions here as Object must first construct extensions + $this->extend('updateFields', $this->fields); + $this->extend('updateActions', $this->actions); } /** @@ -46,7 +49,9 @@ public function setRequiredFields($fields) { * @return FieldList */ public function getFields() { - return $this->getFieldSource(); + $fields = $this->getFieldSource(); + $this->extend('updateFields', $fields); + return $fields; } /** @@ -84,9 +89,11 @@ public static function set_field_source($sourceFn) { * @return FieldList */ public function getActions() { - return new FieldList(array( + $actions = new FieldList(array( new FormAction('doCompleteRegister', 'Complete'), )); + $results = $this->extend('updateActions', $actions); + return $actions; } /**