summaryrefslogtreecommitdiff
path: root/update.php
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-04 05:57:26 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2011-01-04 05:57:26 +0000
commit6cff2ebdfe8efc4f3a206fc68f798776736b17b0 (patch)
treefc8e370f77451ec10219152861cfb165b0cc175c /update.php
parent801a098794922988c304f8e90bd2a946582d55f7 (diff)
downloadbrdo-6cff2ebdfe8efc4f3a206fc68f798776736b17b0.tar.gz
brdo-6cff2ebdfe8efc4f3a206fc68f798776736b17b0.tar.bz2
#1013808 by threewestwinds, redndahead: Fixed update.php displays misleading messages for modules that return no messages.
Diffstat (limited to 'update.php')
-rw-r--r--update.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/update.php b/update.php
index 982af6aaa..4c81955fd 100644
--- a/update.php
+++ b/update.php
@@ -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']);