diff options
Diffstat (limited to 'includes/bootstrap.inc')
-rw-r--r-- | includes/bootstrap.inc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 41dca93ce..320ca3ac7 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -321,8 +321,6 @@ function variable_del($name) { * * Note: we do not serve cached pages when status messages are waiting (from * a redirected form submission which was completed). - * Because the output handler is not activated, the resulting page will not - * get cached either. */ function page_get_cache() { global $user, $base_root; @@ -585,15 +583,21 @@ function drupal_set_message($message = NULL, $type = 'status') { * * @param $type * (optional) Only return messages of this type. + * @param $clear_queue + * (optional) Set to FALSE if you do not want to clear the messages queue */ -function drupal_get_messages($type = NULL) { +function drupal_get_messages($type = NULL, $clear_queue = TRUE) { if ($messages = drupal_set_message()) { if ($type) { - unset($_SESSION['messages'][$type]); + if ($clear_queue) { + unset($_SESSION['messages'][$type]); + } return array($type => $messages[$type]); } else { - unset($_SESSION['messages']); + if ($clear_queue) { + unset($_SESSION['messages']); + } return $messages; } } |