diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 15ef789..2af07a2 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)) { - \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 _theme() can differentiate between a hook that @@ -380,6 +380,10 @@ function _theme($hook, $variables = array()) { if (function_exists($info['function'])) { $output = SafeMarkup::set($info['function']($variables)); } + else { + // The function is registered but does not exist (yet). + trigger_error(sprintf("Missing theme function '%s' for theme hook '%s'. Either rebuild the theme registry and/or correct the definition.", $info['function'], $hook), E_USER_WARNING); + } } else { $render_function = 'twig_render_template';