From e4b8a05985c5374c557358e4cce67bf3cbd35ae0 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Thu, 10 Oct 2024 16:40:45 +1300 Subject: [PATCH] API Deprecations for template layer --- code/Controllers/ContentController.php | 4 ++++ tests/php/Controllers/ContentControllerTest.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/Controllers/ContentController.php b/code/Controllers/ContentController.php index 9b93af99..94811b69 100644 --- a/code/Controllers/ContentController.php +++ b/code/Controllers/ContentController.php @@ -297,9 +297,13 @@ class ContentController extends Controller /** * @return ArrayList + * @deprecated 5.4.0 Use getMenu() instead. You can continue to use $Menu in templates. */ public function Menu($level) { + Deprecation::withSuppressedNotice( + fn() => Deprecation::notice('5.4.0', 'Use getMenu() instead. You can continue to use $Menu in templates.') + ); return $this->getMenu($level); } diff --git a/tests/php/Controllers/ContentControllerTest.php b/tests/php/Controllers/ContentControllerTest.php index 476a23f6..552457a4 100644 --- a/tests/php/Controllers/ContentControllerTest.php +++ b/tests/php/Controllers/ContentControllerTest.php @@ -8,6 +8,7 @@ use SilverStripe\CMS\Model\SiteTree; use SilverStripe\Control\Director; use SilverStripe\Control\HTTPResponse_Exception; use SilverStripe\Core\Config\Config; +use SilverStripe\Dev\Deprecation; use SilverStripe\Dev\FunctionalTest; use SilverStripe\Versioned\Versioned; @@ -204,7 +205,7 @@ class ContentControllerTest extends FunctionalTest __DIR__ . '/themes/controllertest/templates/SilverStripe/CMS/Tests/Controllers/' . 'ContentControllerTestPage_test.ss', - $viewer->templates()['main'] + Deprecation::withSuppressedNotice(fn() => $viewer->templates())['main'] ); }); }