Issue #2662574 by RajeevK, Adita, pritish.kumar, afi13, greyghost, tstoeckler, xjm, Cottser, dawehner: Theme suggestions may not be in theme include files, Search and Views UI suggestions are not (always) found

8.5.x
xjm 2017-12-04 21:20:01 -06:00
parent acaf93a810
commit d6fb4a503c
5 changed files with 22 additions and 14 deletions

View File

@ -613,6 +613,10 @@ function hook_preprocess_HOOK(&$variables) {
* hook called (in this case 'node__article') is available in * hook called (in this case 'node__article') is available in
* $variables['theme_hook_original']. * $variables['theme_hook_original'].
* *
* Implementations of this hook must be placed in *.module or *.theme files, or
* must otherwise make sure that the hook implementation is available at
* any given time.
*
* @todo Add @code sample. * @todo Add @code sample.
* *
* @param array $variables * @param array $variables
@ -694,6 +698,10 @@ function hook_theme_suggestions_alter(array &$suggestions, array $variables, $ho
* hook called (in this case 'node__article') is available in * hook called (in this case 'node__article') is available in
* $variables['theme_hook_original']. * $variables['theme_hook_original'].
* *
* Implementations of this hook must be placed in *.module or *.theme files, or
* must otherwise make sure that the hook implementation is available at
* any given time.
*
* @todo Add @code sample. * @todo Add @code sample.
* *
* @param array $suggestions * @param array $suggestions

View File

@ -106,6 +106,13 @@ function search_theme() {
]; ];
} }
/**
* Implements hook_theme_suggestions_HOOK().
*/
function search_theme_suggestions_search_result(array $variables) {
return ['search_result__' . $variables['plugin_id']];
}
/** /**
* Implements hook_preprocess_HOOK() for block templates. * Implements hook_preprocess_HOOK() for block templates.
*/ */

View File

@ -8,13 +8,6 @@
use Drupal\Component\Utility\UrlHelper; use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageInterface;
/**
* Implements hook_theme_suggestions_HOOK().
*/
function search_theme_suggestions_search_result(array $variables) {
return ['search_result__' . $variables['plugin_id']];
}
/** /**
* Prepares variables for individual search result templates. * Prepares variables for individual search result templates.
* *

View File

@ -156,6 +156,13 @@ function views_ui_preprocess_views_view(&$variables) {
} }
} }
/**
* Implements hook_theme_suggestions_HOOK().
*/
function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) {
return ['views_ui_view_preview_section__' . $variables['section']];
}
/** /**
* Returns contextual links for each handler of a certain section. * Returns contextual links for each handler of a certain section.
* *

View File

@ -547,10 +547,3 @@ function template_preprocess_views_ui_view_preview_section(&$variables) {
$variables['links'] = $build; $variables['links'] = $build;
} }
} }
/**
* Implements hook_theme_suggestions_HOOK().
*/
function views_ui_theme_suggestions_views_ui_view_preview_section(array $variables) {
return ['views_ui_view_preview_section__' . $variables['section']];
}