From fb22b990589a32ad1be149be7a758644b840a241 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 21 Aug 2024 10:12:08 +1200 Subject: [PATCH] API Replace Extension subclasses --- src/Extensions/WorkflowApplicable.php | 6 +++--- src/Extensions/WorkflowEmbargoExpiryExtension.php | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Extensions/WorkflowApplicable.php b/src/Extensions/WorkflowApplicable.php index 284682b9..a39ecdf7 100644 --- a/src/Extensions/WorkflowApplicable.php +++ b/src/Extensions/WorkflowApplicable.php @@ -17,7 +17,7 @@ use SilverStripe\Forms\Tab; use SilverStripe\Forms\TabSet; use SilverStripe\ORM\CMSPreviewable; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\ORM\DataList; use SilverStripe\ORM\DataObject; use SilverStripe\ORM\ManyManyList; @@ -41,9 +41,9 @@ * @method WorkflowDefinition WorkflowDefinition() * @method ManyManyList AdditionalWorkflowDefinitions() * - * @extends DataExtension + * @extends Extension */ -class WorkflowApplicable extends DataExtension +class WorkflowApplicable extends Extension { private static $has_one = [ 'WorkflowDefinition' => WorkflowDefinition::class, diff --git a/src/Extensions/WorkflowEmbargoExpiryExtension.php b/src/Extensions/WorkflowEmbargoExpiryExtension.php index b7055558..cf760f56 100644 --- a/src/Extensions/WorkflowEmbargoExpiryExtension.php +++ b/src/Extensions/WorkflowEmbargoExpiryExtension.php @@ -10,7 +10,7 @@ use SilverStripe\Forms\HeaderField; use SilverStripe\Forms\LiteralField; use SilverStripe\ORM\ArrayList; -use SilverStripe\ORM\DataExtension; +use SilverStripe\Core\Extension; use SilverStripe\ORM\DataQuery; use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBHTMLText; @@ -39,9 +39,9 @@ * @method QueuedJobDescriptor PublishJob() * @method QueuedJobDescriptor UnPublishJob() * - * @extends DataExtension + * @extends Extension */ -class WorkflowEmbargoExpiryExtension extends DataExtension +class WorkflowEmbargoExpiryExtension extends Extension { private static $db = array( 'DesiredPublishDate' => 'DBDatetime', @@ -261,8 +261,6 @@ protected function onBeforeDuplicate($original, $doWrite) */ protected function onBeforeWrite() { - parent::onBeforeWrite(); - // only operate on staging content for this extension; otherwise, you // need to publish the page to be able to set a 'future' publish... // while the same could be said for the unpublish, the 'publish' state