diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-21 06:40:05 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-21 06:40:05 +0000 |
commit | d151ea91004abd0c771dfeea380ff4fef0fbf248 (patch) | |
tree | 82f35e960ccd63ec98175a9d56f7a2bab51ad1ac /update.php | |
parent | 0e116ff9cfc117c3ab5d1354cab99175061db134 (diff) | |
download | brdo-d151ea91004abd0c771dfeea380ff4fef0fbf248.tar.gz brdo-d151ea91004abd0c771dfeea380ff4fef0fbf248.tar.bz2 |
#554754 by gordon and dww: Added a new function update_get_update_list() to return list of pending updates.
Diffstat (limited to 'update.php')
-rw-r--r-- | update.php | 66 |
1 files changed, 22 insertions, 44 deletions
diff --git a/update.php b/update.php index 0eb1e6118..4addccb70 100644 --- a/update.php +++ b/update.php @@ -48,51 +48,29 @@ function update_script_selection_form() { // Ensure system.module's updates appear first $form['start']['system'] = array(); - $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE); - foreach ($modules as $module => $schema_version) { - $pending = array(); - $updates = drupal_get_schema_versions($module); - // Skip incompatible module updates completely, otherwise test schema versions. - if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) { - // module_invoke returns NULL for nonexisting hooks, so if no updates - // are removed, it will == 0. - $last_removed = module_invoke($module, 'update_last_removed'); - if ($schema_version < $last_removed) { - $form['start'][$module] = array( - '#title' => $module, - '#item' => '<em>' . $module . '</em> module can not be updated. Its schema version is ' . $schema_version . '. Updates up to and including ' . $last_removed . ' have been removed in this release. In order to update <em>' . $module . '</em> module, you will first <a href="http://drupal.org/upgrade">need to upgrade</a> to the last version in which these updates were available.', - '#prefix' => '<div class="warning">', - '#suffix' => '</div>', - ); - continue; - } - $updates = drupal_map_assoc($updates); - foreach (array_keys($updates) as $update) { - if ($update > $schema_version) { - // The description for an update comes from its Doxygen. - $func = new ReflectionFunction($module . '_update_' . $update); - $description = str_replace(array("\n", '*', '/'), '', $func->getDocComment()); - $pending[] = "$update - $description"; - if (!isset($default)) { - $default = $update; - } - } - } - if (!empty($pending)) { - if (!isset($default)) { - $default = $schema_version; - } - $form['start'][$module] = array( - '#type' => 'hidden', - '#value' => $default, - ); - $form['start'][$module . '_updates'] = array( - '#markup' => theme('item_list', $pending, $module . ' module'), - ); - } + $updates = update_get_update_list(); + foreach ($updates as $module => $update) { + if (!isset($update['start'])) { + $form['start'][$module] = array( + '#title' => $module, + '#item' => $update['warning'], + '#prefix' => '<div class="warning">', + '#suffix' => '</div>', + ); + continue; + } + if (!empty($update['pending'])) { + $form['start'][$module] = array( + '#type' => 'hidden', + '#value' => $update['start'], + ); + $form['start'][$module . '_updates'] = array( + '#markup' => theme('item_list', $update['pending'], $module . ' module'), + ); + } + if (isset($update['pending'])) { + $count = $count + count($update['pending']); } - unset($default); - $count = $count + count($pending); } if (empty($count)) { |