summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/install.inc7
-rw-r--r--includes/update.inc12
2 files changed, 13 insertions, 6 deletions
diff --git a/includes/install.inc b/includes/install.inc
index 577724c0a..9af6644e0 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -95,6 +95,11 @@ function drupal_get_schema_versions($module) {
$updates = &drupal_static(__FUNCTION__, NULL);
if (!isset($updates[$module])) {
$updates = array();
+
+ foreach (module_list() as $loaded_module) {
+ $updates[$loaded_module] = array();
+ }
+
// Prepare regular expression to match all possible defined hook_update_N().
$regexp = '/^(?P<module>.+)_update_(?P<version>\d+)$/';
$functions = get_defined_functions();
@@ -117,7 +122,7 @@ function drupal_get_schema_versions($module) {
sort($module_updates, SORT_NUMERIC);
}
}
- return isset($updates[$module]) ? $updates[$module] : FALSE;
+ return empty($updates[$module]) ? FALSE : $updates[$module];
}
/**
diff --git a/includes/update.inc b/includes/update.inc
index ba83db0db..8157eeabe 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -1041,11 +1041,13 @@ function update_get_update_function_list($starting_updates) {
foreach ($starting_updates as $module => $version) {
$update_functions[$module] = array();
$updates = drupal_get_schema_versions($module);
- $max_version = max($updates);
- if ($version <= $max_version) {
- foreach ($updates as $update) {
- if ($update >= $version) {
- $update_functions[$module][$update] = $module . '_update_' . $update;
+ if ($updates !== FALSE) {
+ $max_version = max($updates);
+ if ($version <= $max_version) {
+ foreach ($updates as $update) {
+ if ($update >= $version) {
+ $update_functions[$module][$update] = $module . '_update_' . $update;
+ }
}
}
}