diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 72b2b88..dac8591 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2317,10 +2317,12 @@ function drupal_common_theme() { 'authorize_message' => array( 'variables' => array('message' => NULL, 'success' => TRUE), 'function' => 'theme_authorize_message', + 'file' => 'theme.maintenance.inc', ), 'authorize_report' => array( 'variables' => array('messages' => array()), 'function' => 'theme_authorize_report', + 'file' => 'theme.maintenance.inc', ), // From pager.inc. 'pager' => array( diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index 1c883d5..e56f944 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -452,7 +452,11 @@ protected function processExtension(&$cache, $name, $type, $theme, $path) { // theme hook provides a theme function callback, check to ensure that // it actually exists. if (isset($info['function']) && !function_exists($info['function'])) { - continue; + throw new \BadFunctionCallException(sprintf( + 'Theme hook "%s" refers to a theme function callback that does not exist: "%s"', + $hook, + $info['function'] + )); } // Provide a default naming convention for 'template' based on the // hook used. If the template does not exist, the theme engine used diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 6364e90..88aecfc 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1100,14 +1100,17 @@ function hook_help($route_name, \Drupal\Core\Routing\RouteMatchInterface $route_ * - template: If specified, this theme implementation is a template, and * this is the template file without an extension. If neither 'template' * nor 'function' is specified, a default template name will be assumed. - * For example, if a module registers the 'node' theme hook, 'node' - * will be assigned to its template. Do not put .html.twig on this file; - * that extension will be added automatically by the default rendering - * engine (which is Twig). If 'path' above is specified, the template should - * also be in this path. - * - function: If specified, this will be the function name to invoke for - * this implementation. If the chameleon theme registers the node hook, - * it will be assigned 'chameleon_node' as its function. + * For example, if a module registers the 'search_result' theme hook, + * 'search-result' will be assigned to its template. Do not put .html.twig + * on this file, that extension will be added automatically by the default + * rendering engine (which is Twig). If 'path' above is specified, the + * template should also be in this path. + * - function: If the theme implementation is not a template but a theme + * function, you must specify the function name. For example, a theme hook + * of 'search_result' would, by convention, use a theme function of + * 'theme_search_result'. So, if you are building a theme called 'chameleon' + * , that registers a new 'search_result' hook and theme function, then you + * would usually use 'chameleon_search_result' as the theme function name. * - base hook: Used for _theme() suggestions only: the base theme hook name. * Instead of this suggestion's implementation being used directly, the base * hook will be invoked with this implementation as its first suggestion.