summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/theme.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index f3ace1368..44946cf53 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2257,7 +2257,6 @@ function template_preprocess_page(&$variables) {
$variables['language'] = $GLOBALS['language'];
$variables['language']->dir = $GLOBALS['language']->direction ? 'rtl' : 'ltr';
$variables['logo'] = theme_get_setting('logo');
- $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';
$variables['main_menu'] = theme_get_setting('toggle_main_menu') ? menu_main_menu() : array();
$variables['secondary_menu'] = theme_get_setting('toggle_secondary_menu') ? menu_secondary_menu() : array();
$variables['action_links'] = menu_local_actions();
@@ -2295,6 +2294,12 @@ function template_process_page(&$variables) {
if (!isset($variables['title'])) {
$variables['title'] = drupal_get_title();
}
+
+ // Generate messages last in order to capture as many as possible for the
+ // current page.
+ if (!isset($variables['messages'])) {
+ $variables['messages'] = $variables['show_messages'] ? theme('status_messages') : '';
+ }
}
/**