Commit 6cff2ebd authored by webchick's avatar webchick

#1013808 by threewestwinds, redndahead: Fixed update.php displays misleading...

#1013808 by threewestwinds, redndahead: Fixed update.php displays misleading messages for modules that return no messages.
parent 801a0987
......@@ -179,11 +179,11 @@ function update_results_page() {
// Output a list of queries executed.
if (!empty($_SESSION['update_results'])) {
$output .= '<div id="update-results">';
$output .= '<h2>The following updates returned messages</h2>';
$all_messages = '';
foreach ($_SESSION['update_results'] as $module => $updates) {
if ($module != '#abort') {
$output .= '<h3>' . $module . ' module</h3>';
$module_has_message = FALSE;
$query_messages = '';
foreach ($updates as $number => $queries) {
$messages = array();
foreach ($queries as $query) {
......@@ -191,6 +191,7 @@ function update_results_page() {
if (empty($query['query'])) {
continue;
}
if ($query['success']) {
$messages[] = '<li class="success">' . $query['query'] . '</li>';
}
......@@ -200,13 +201,24 @@ function update_results_page() {
}
if ($messages) {
$output .= '<h4>Update #' . $number . "</h4>\n";
$output .= '<ul>' . implode("\n", $messages) . "</ul>\n";
$module_has_message = TRUE;
$query_messages .= '<h4>Update #' . $number . "</h4>\n";
$query_messages .= '<ul>' . implode("\n", $messages) . "</ul>\n";
}
}
// If there were any messages in the queries then prefix them with the
// module name and add it to the global message list.
if ($module_has_message) {
$all_messages .= '<h3>' . $module . " module</h3>\n" . $query_messages;
}
}
}
$output .= '</div>';
if ($all_messages) {
$output .= '<div id="update-results"><h2>The following updates returned messages</h2>';
$output .= $all_messages;
$output .= '</div>';
}
}
unset($_SESSION['update_results']);
unset($_SESSION['update_success']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment