From 44156558487117cb07f0312de3aa399149adfbbf Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 25 Sep 2018 16:48:01 +0200 Subject: [PATCH] NEW Add update extension hooks for LinkFormFactory subclasses --- code/Forms/EditorEmailLinkFormFactory.php | 2 ++ code/Forms/LinkFormFactory.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/code/Forms/EditorEmailLinkFormFactory.php b/code/Forms/EditorEmailLinkFormFactory.php index deeffadb4..02c8adc76 100644 --- a/code/Forms/EditorEmailLinkFormFactory.php +++ b/code/Forms/EditorEmailLinkFormFactory.php @@ -29,6 +29,8 @@ protected function getFormFields($controller, $name, $context) $fields->insertAfter('Link', TextField::create('Text', _t(__CLASS__.'.LINKTEXT', 'Link text'))); } + $this->extend('updateFormFields', $fields, $controller, $name, $context); + return $fields; } diff --git a/code/Forms/LinkFormFactory.php b/code/Forms/LinkFormFactory.php index 5f00a221d..b154a47eb 100644 --- a/code/Forms/LinkFormFactory.php +++ b/code/Forms/LinkFormFactory.php @@ -43,6 +43,8 @@ public function getForm(RequestHandler $controller = null, $name = FormFactory:: $form = Form::create($controller, $name, $fields, $actions, $validator); $form->addExtraClass('form--no-dividers'); + $this->extend('updateForm', $form, $controller, $name, $context); + return $form; } @@ -55,6 +57,8 @@ protected function getFormActions($controller, $name, $context) ->setSchemaData(['data' => ['buttonStyle' => 'primary']]), ]); + $this->extend('updateFormActions', $actions, $controller, $name, $context); + return $actions; }