Commit 0e5386e3 authored by Dries's avatar Dries
Browse files

Issue #1843668 by Cottser, bdragon, joelpittet, gloob: Move building of...

Issue #1843668 by Cottser, bdragon, joelpittet, gloob: Move building of breadcrumb render array from template_process_page() to template_preprocess_page().
parent 81cfa891
......@@ -2803,6 +2803,15 @@ function template_preprocess_page(&$variables) {
'#theme' => 'status_messages',
'#access' => $variables['show_messages'],
);
// Set the breadcrumb last, so as to increase the chance of being able to
// re-use the cache of an already retrieved menu containing the active link
// for the current page.
// @see menu_tree_page_data()
$variables['breadcrumb'] = array(
'#theme' => 'breadcrumb',
'#breadcrumb' => \Drupal::service('breadcrumb')->build(\Drupal::request()->attributes->all()),
);
}
/**
......@@ -2814,16 +2823,6 @@ function template_preprocess_page(&$variables) {
* @see template_preprocess_page()
*/
function template_process_page(&$variables) {
if (!isset($variables['breadcrumb'])) {
// Build the breadcrumb last, so as to increase the chance of being able to
// re-use the cache of an already rendered menu containing the active link
// for the current page.
// @see menu_tree_page_data()
$variables['breadcrumb'] = array(
'#theme' => 'breadcrumb',
'#breadcrumb' => \Drupal::service('breadcrumb')->build(\Drupal::service('request')->attributes->all()),
);
}
if (!isset($variables['title'])) {
$variables['title'] = drupal_get_title();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment