API Deprecations for template layer

This commit is contained in:
Guy Sartorelli 2024-10-10 16:40:45 +13:00
parent df82162291
commit e4b8a05985
No known key found for this signature in database
2 changed files with 6 additions and 1 deletions

View File

@ -297,9 +297,13 @@ class ContentController extends Controller
/**
* @return ArrayList<SiteTree>
* @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);
}

View File

@ -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']
);
});
}