Skip to content
Permalink
Browse files

fix(views): always show all system messages (success and error)

fixes #2772
  • Loading branch information...
jdalsem committed Feb 10, 2015
1 parent 306fe6c commit 01156baa8baeef53e8b5c34079f387421e1d610a
Showing with 10 additions and 8 deletions.
  1. +10 −8 engine/lib/views.php
@@ -446,14 +446,16 @@ function elgg_view_page($title, $body, $page_shell = 'default', $vars = array())
$messages = null;
if ($system_messages->count()) {
// get messages - try for errors first
$messages = $system_messages->dumpRegister('error');
if (count($messages["error"]) == 0) {
// no errors so grab rest of messages
$messages = $system_messages->dumpRegister();
} else {
// we have errors - clear out remaining messages
$system_messages->dumpRegister();
$messages = $system_messages->dumpRegister();
if (isset($messages['error'])) {
// always make sure error is the first type
$errors = array(
'error' => $messages['error']
);
unset($messages['error']);
$messages = array_merge($errors, $messages);
}
}

0 comments on commit 01156ba

Please sign in to comment.
You can’t perform that action at this time.