summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries2013-07-18 18:54:44 (GMT)
committer Dries2013-07-18 18:54:44 (GMT)
commit0e5386e3ec7234f3996a447dba66f20c98fc460a (patch)
tree6405105f740a039dfd2c6c3d1c9ea93737898adc
parent81cfa89160653d847520625cd4ee0c12de532cb3 (diff)
Issue #1843668 by Cottser, bdragon, joelpittet, gloob: Move building of breadcrumb render array from template_process_page() to template_preprocess_page().
-rw-r--r--core/includes/theme.inc19
1 files changed, 9 insertions, 10 deletions
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 83fec4e..81ea4e3 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -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();
}