Skip to content

Commit

Permalink
ENH Don't emit deprecation warnings for unavoidable API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 14, 2024
1 parent 36677ad commit 8ebcd20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Controllers/LinkFieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\HiddenField;
use SilverStripe\LinkField\Services\LinkTypeService;
use SilverStripe\ORM\DataList;
Expand Down Expand Up @@ -133,7 +134,8 @@ public function linkDelete(): HTTPResponse
}
$link = $this->linkFromRequest();
if ($link->hasExtension(Versioned::class)) {
if (!$link->canArchive()) {
$canArchive = Deprecation::withNoReplacement(fn() => $link->canArchive());
if (!$canArchive) {
$this->jsonError(403);
}
$link->doArchive();
Expand Down

0 comments on commit 8ebcd20

Please sign in to comment.