diff --git a/core/lib/Drupal/Core/Theme/ThemeManager.php b/core/lib/Drupal/Core/Theme/ThemeManager.php index 0cbd529..c10afa4 100644 --- a/core/lib/Drupal/Core/Theme/ThemeManager.php +++ b/core/lib/Drupal/Core/Theme/ThemeManager.php @@ -161,7 +161,7 @@ public function render($hook, array $variables) { $original_hook = $hook; // If there's no implementation, check for more generic fallbacks. - // If there's still no implementation, log an error and return an empty + // If there's still no implementation, trigger an error and return an empty // string. if (!$theme_registry->has($hook)) { // Iteratively strip everything after the last '__' delimiter, until an @@ -173,10 +173,10 @@ public function render($hook, array $variables) { } } if (!$theme_registry->has($hook)) { - // Only log a message when not trying theme suggestions ($hook being an - // array). + // Only trigger an error when not trying theme suggestions ($hook being + // an array). if (!isset($candidate)) { - \Drupal::logger('theme')->warning('Theme hook %hook not found.', array('%hook' => $hook)); + trigger_error(sprintf("Unknown theme hook '%s'.", $original_hook), E_USER_ERROR); } // There is no theme implementation for the hook passed. Return FALSE so // the function calling @@ -321,6 +321,9 @@ public function render($hook, array $variables) { // has been written correctly and that the markup is safe. $output = Markup::create($info['function']($variables)); } + else { + trigger_error(sprintf("Missing theme function '%s' for theme hook '%s'.", $info['function'], $hook), E_USER_ERROR); + } } else { $render_function = 'twig_render_template'; diff --git a/core/modules/node/src/Tests/NodeListBuilderTest.php b/core/modules/node/src/Tests/NodeListBuilderTest.php index 2d23604..e4a0d35 100644 --- a/core/modules/node/src/Tests/NodeListBuilderTest.php +++ b/core/modules/node/src/Tests/NodeListBuilderTest.php @@ -20,7 +20,7 @@ class NodeListBuilderTest extends KernelTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'user']; + public static $modules = ['node', 'user', 'system']; protected function setUp() { parent::setUp(); diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 066afcc..01cede5 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -438,3 +438,12 @@ function shortcut_themes_installed($theme_list) { } } } + +/** + * Implements hook_entity_type_alter(). + */ +function shortcut_entity_type1_alter(&$entity_types) { + // Unset view builder for Shortcut entity which is set by default in + // Drupal\Core\Entity\ContentEntityBase. + $entity_types['shortcut']->setViewBuilderClass(NULL); +}