mirror of
https://github.com/silverstripe/silverstripe-externallinks.git
synced 2024-10-22 17:05:44 +02:00
ENH Don't use deprecated method (#149)
This commit is contained in:
parent
175c75419a
commit
bce020bea8
@ -187,7 +187,7 @@ class CheckExternalLinksTask extends BuildTask
|
||||
|
||||
// Check value of html area
|
||||
$page = $pageTrack->Page();
|
||||
Deprecation::withNoReplacement(fn() => $this->log("Checking {$page->Title}"));
|
||||
Deprecation::withSuppressedNotice(fn() => $this->log("Checking {$page->Title}"));
|
||||
$htmlValue = Injector::inst()->create(HTMLValue::class, $page->Content);
|
||||
if (!$htmlValue->isValid()) {
|
||||
continue;
|
||||
@ -205,7 +205,7 @@ class CheckExternalLinksTask extends BuildTask
|
||||
try {
|
||||
$page->write();
|
||||
} catch (ValidationException $ex) {
|
||||
Deprecation::withNoReplacement(function () use ($page, $ex) {
|
||||
Deprecation::withSuppressedNotice(function () use ($page, $ex) {
|
||||
$this->log("Exception caught for {$page->Title}, skipping. Message: " . $ex->getMessage());
|
||||
});
|
||||
continue;
|
||||
@ -213,7 +213,7 @@ class CheckExternalLinksTask extends BuildTask
|
||||
|
||||
// Once all links have been created for this page update HasBrokenLinks
|
||||
$count = $pageTrack->BrokenLinks()->count();
|
||||
Deprecation::withNoReplacement(fn() => $this->log("Found {$count} broken links"));
|
||||
Deprecation::withSuppressedNotice(fn() => $this->log("Found {$count} broken links"));
|
||||
if ($count) {
|
||||
$siteTreeTable = DataObject::getSchema()->tableName(SiteTree::class);
|
||||
// Bypass the ORM as syncLinkTracking does not allow you to update HasBrokenLink to true
|
||||
|
@ -36,7 +36,7 @@ class ExternalLinksTest extends FunctionalTest
|
||||
{
|
||||
// Run link checker
|
||||
$task = CheckExternalLinksTask::create();
|
||||
Deprecation::withNoReplacement(fn() => $task->setSilent(true)); // Be quiet during the test!
|
||||
Deprecation::withSuppressedNotice(fn() => $task->setSilent(true)); // Be quiet during the test!
|
||||
$task->runLinksCheck();
|
||||
|
||||
// Get all links checked
|
||||
@ -113,7 +113,7 @@ class ExternalLinksTest extends FunctionalTest
|
||||
{
|
||||
// Run link checker
|
||||
$task = CheckExternalLinksTask::create();
|
||||
Deprecation::withNoReplacement(fn() => $task->setSilent(true)); // Be quiet during the test!
|
||||
Deprecation::withSuppressedNotice(fn() => $task->setSilent(true)); // Be quiet during the test!
|
||||
$task->runLinksCheck();
|
||||
|
||||
// Ensure report lists all broken links
|
||||
|
Loading…
Reference in New Issue
Block a user