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); } /**