diff --git includes/menu.inc includes/menu.inc index c793ae3..ecfeebf 100644 --- includes/menu.inc +++ includes/menu.inc @@ -1117,7 +1117,7 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = // If we are asked for the active trail only, and $menu_name has not been // built and cached for this page yet, then this likely means that it // won't be built anymore, as this function is invoked from - // template_preprocess_page(). So in order to not build a giant menu tree + // template_process_page(). So in order to not build a giant menu tree // that needs to be checked for access on all levels, we simply check // whether we have the menu already in cache, or otherwise, build a minimum // tree containing the breadcrumb/active trail only. diff --git includes/theme.inc includes/theme.inc index b2e34bc..0175c2d 100644 --- includes/theme.inc +++ includes/theme.inc @@ -2268,12 +2268,6 @@ function template_preprocess_page(&$variables) { $variables['site_name'] = (theme_get_setting('toggle_name') ? filter_xss_admin(variable_get('site_name', 'Drupal')) : ''); $variables['site_slogan'] = (theme_get_setting('toggle_slogan') ? filter_xss_admin(variable_get('site_slogan', '')) : ''); $variables['tabs'] = theme('menu_local_tasks'); - // 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'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); - $variables['title'] = drupal_get_title(); if ($node = menu_get_object()) { $variables['node'] = $node; @@ -2286,6 +2280,29 @@ function template_preprocess_page(&$variables) { } /** + * Process variables for page.tpl.php + * + * Perform final addition and modification of variables before passing into + * the template. To customize these variables, simply set them in an earlier + * step already. + * + * @see template_preprocess_page() + * @see page.tpl.php + */ +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'] = theme('breadcrumb', array('breadcrumb' => drupal_get_breadcrumb())); + } + if (!isset($variables['title'])) { + $variables['title'] = drupal_get_title(); + } +} + +/** * Process variables for html.tpl.php * * Perform final addition and modification of variables before passing into