From b8c73479a1edb70afd5ba8da85a76a53a03d60d7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:27:26 +1200 Subject: [PATCH 1/2] ENH Don't use deprecated method (#205) --- src/Extension/Engine/SiteTreePublishingEngine.php | 2 +- src/Task/StaticCacheFullBuildTask.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Extension/Engine/SiteTreePublishingEngine.php b/src/Extension/Engine/SiteTreePublishingEngine.php index b566d56..669ac42 100644 --- a/src/Extension/Engine/SiteTreePublishingEngine.php +++ b/src/Extension/Engine/SiteTreePublishingEngine.php @@ -284,7 +284,7 @@ public function collectChanges($context) } // Fetch our objects to be actioned - Deprecation::withNoReplacement(function () use ($siteTree, $context): void { + Deprecation::withSuppressedNotice(function () use ($siteTree, $context): void { $this->setToUpdate($siteTree->objectsToUpdate($context)); $this->setToDelete($siteTree->objectsToDelete($context)); }); diff --git a/src/Task/StaticCacheFullBuildTask.php b/src/Task/StaticCacheFullBuildTask.php index 172947b..63e1ee4 100644 --- a/src/Task/StaticCacheFullBuildTask.php +++ b/src/Task/StaticCacheFullBuildTask.php @@ -43,7 +43,7 @@ public function run($request) $existing = DataList::create(QueuedJobDescriptor::class)->filter($filter)->first(); if ($existing && $existing->exists()) { - Deprecation::withNoReplacement(function () use ($existing) { + Deprecation::withSuppressedNotice(function () use ($existing) { $this->log(sprintf( 'There is already a %s in the queue, added %s %s', StaticCacheFullBuildJob::class, @@ -74,14 +74,14 @@ public function run($request) // sanity check that we are in the next 24 hours - prevents some weird stuff sneaking through if ($startAfter->getTimestamp() > $thisTimeTomorrow || $startAfter->getTimestamp() < $now->getTimestamp()) { - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { $this->log('Invalid startAfter parameter passed. Please ensure the time format is HHmm e.g. 1300'); }); return false; } - Deprecation::withNoReplacement(function () use ($startAfter, $dayWord) { + Deprecation::withSuppressedNotice(function () use ($startAfter, $dayWord) { $this->log(sprintf( '%s queued for %s %s.', StaticCacheFullBuildJob::class, @@ -91,7 +91,7 @@ public function run($request) }); } else { $startAfter = null; - Deprecation::withNoReplacement(function () { + Deprecation::withSuppressedNotice(function () { $this->log(StaticCacheFullBuildJob::class . ' added to the queue for immediate processing'); }); } From 0bc277f2e6696314368312b6060fabae6c7d2b21 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 23 Sep 2024 15:15:58 +1200 Subject: [PATCH 2/2] DEP Increase minimum version of silverstripe/framework --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 555079b..dbe656a 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ], "require": { "php": "^8.1", - "silverstripe/framework": "^5.1", + "silverstripe/framework": "^5.4", "silverstripe/cms": "^5", "silverstripe/config": "^2", "symbiote/silverstripe-queuedjobs": "^5",