Commit f3069ccf authored by xjm's avatar xjm
Browse files

Issue #3117330 by longwave, tedbow, xjm: Trigger errors in deprecated theme functions

parent 6cd25dfd
...@@ -495,7 +495,7 @@ protected function processExtension(array &$cache, $name, $type, $theme, $path) ...@@ -495,7 +495,7 @@ protected function processExtension(array &$cache, $name, $type, $theme, $path)
// if the theme hook specifies a function callback instead, check to // if the theme hook specifies a function callback instead, check to
// ensure the function actually exists. // ensure the function actually exists.
if (isset($info['function'])) { if (isset($info['function'])) {
@trigger_error(sprintf('Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of %s(). See https://www.drupal.org/node/1831138', $info['function']), E_USER_DEPRECATED); trigger_error(sprintf('Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of %s(). See https://www.drupal.org/node/1831138', $info['function']), E_USER_DEPRECATED);
if (!function_exists($info['function'])) { if (!function_exists($info['function'])) {
throw new \BadFunctionCallException(sprintf( throw new \BadFunctionCallException(sprintf(
'Theme hook "%s" refers to a theme function callback that does not exist: "%s"', 'Theme hook "%s" refers to a theme function callback that does not exist: "%s"',
......
...@@ -27,7 +27,7 @@ class RegistryLegacyTest extends KernelTestBase { ...@@ -27,7 +27,7 @@ class RegistryLegacyTest extends KernelTestBase {
/** /**
* Tests the theme registry with theme functions and multiple subthemes. * Tests the theme registry with theme functions and multiple subthemes.
* *
* @expectedDeprecation Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_theme_test(). See https://www.drupal.org/node/1831138 * @expectedDeprecation Unsilenced deprecation: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_theme_test(). See https://www.drupal.org/node/1831138
*/ */
public function testMultipleSubThemes() { public function testMultipleSubThemes() {
$theme_handler = \Drupal::service('theme_handler'); $theme_handler = \Drupal::service('theme_handler');
...@@ -47,7 +47,7 @@ public function testMultipleSubThemes() { ...@@ -47,7 +47,7 @@ public function testMultipleSubThemes() {
/** /**
* Tests the theme registry with theme functions with suggestions. * Tests the theme registry with theme functions with suggestions.
* *
* @expectedDeprecation Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of test_legacy_theme_theme_test_preprocess_suggestions__kitten__meerkat(). See https://www.drupal.org/node/1831138 * @expectedDeprecation Unsilenced deprecation: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of test_legacy_theme_theme_test_preprocess_suggestions__kitten__meerkat(). See https://www.drupal.org/node/1831138
*/ */
public function testSuggestionPreprocessFunctions() { public function testSuggestionPreprocessFunctions() {
$theme_handler = \Drupal::service('theme_handler'); $theme_handler = \Drupal::service('theme_handler');
......
...@@ -83,7 +83,7 @@ protected function setUp() { ...@@ -83,7 +83,7 @@ protected function setUp() {
/** /**
* Tests getting legacy theme function registry data defined by a module. * Tests getting legacy theme function registry data defined by a module.
* *
* @expectedDeprecation Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_theme_test(). See https://www.drupal.org/node/1831138 * @expectedDeprecation Unsilenced deprecation: Theme functions are deprecated in drupal:8.0.0 and are removed from drupal:10.0.0. Use Twig templates instead of theme_theme_test(). See https://www.drupal.org/node/1831138
*/ */
public function testGetLegacyThemeFunctionRegistryForModule() { public function testGetLegacyThemeFunctionRegistryForModule() {
$test_theme = new ActiveTheme([ $test_theme = new ActiveTheme([
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment