diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3dc3a79..c75039f 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -253,10 +253,10 @@ function _theme($hook, $variables = array()) { } } if (!$theme_registry->has($hook)) { - // Only log a message when not trying theme suggestions ($hook being an + // Only trigger an error when not trying theme suggestions ($hook being an // array). if (!isset($candidate)) { - trigger_error(sprintf("Theme hook %s not found.", $hook), E_USER_ERROR); + trigger_error(sprintf("Theme hook %s not found.", $original_hook), E_USER_ERROR); } // There is no theme implementation for the hook passed. Return FALSE so // the function calling _theme() can differentiate between a hook that diff --git a/core/modules/block_content/src/BlockContentViewBuilder.php b/core/modules/block_content/src/BlockContentViewBuilder.php index 545dd91..ff2a853 100644 --- a/core/modules/block_content/src/BlockContentViewBuilder.php +++ b/core/modules/block_content/src/BlockContentViewBuilder.php @@ -21,6 +21,8 @@ class BlockContentViewBuilder extends EntityViewBuilder { */ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { $build = parent::getBuildDefaults($entity, $view_mode, $langcode); + // The custom block will be rendered in the wrapped block template already + // and thus has no entity template itself. unset($build['#theme']); return $build; } diff --git a/core/modules/contact/src/MessageViewBuilder.php b/core/modules/contact/src/MessageViewBuilder.php index 3295dbc..23e9b43 100644 --- a/core/modules/contact/src/MessageViewBuilder.php +++ b/core/modules/contact/src/MessageViewBuilder.php @@ -22,6 +22,8 @@ class MessageViewBuilder extends EntityViewBuilder { */ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { $build = parent::getBuildDefaults($entity, $view_mode, $langcode); + // The message fields are individually rendered into email templates, so + // the entity has no template itself. unset($build['#theme']); return $build; }