From c8517ba9437079d198f9a307011b81152627e48b Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:48:14 +1300 Subject: [PATCH] API API Replace getCMSValidator with updateCMSCompositeValidator (#566) --- src/Extensions/WorkflowEmbargoExpiryExtension.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Extensions/WorkflowEmbargoExpiryExtension.php b/src/Extensions/WorkflowEmbargoExpiryExtension.php index 1b246a92..ad4012cc 100644 --- a/src/Extensions/WorkflowEmbargoExpiryExtension.php +++ b/src/Extensions/WorkflowEmbargoExpiryExtension.php @@ -11,6 +11,7 @@ use SilverStripe\Forms\LiteralField; use SilverStripe\Model\List\ArrayList; use SilverStripe\Core\Extension; +use SilverStripe\Forms\Validation\CompositeValidator; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBHTMLText; @@ -425,14 +426,11 @@ public function getIntroMessage($key) return $msg; } - /* - * Validate - */ - public function getCMSValidator() + protected function updateCMSCompositeValidator(CompositeValidator $validator): void { $required = new AWRequiredFieldsValidator(); $required->setCaller($this); - return $required; + $validator->addValidator($required); } /**