--- modules/update/update.compare.inc.~1.2.~ 2008-01-10 09:56:14.000000000 -0800 +++ modules/update/update.compare.inc 2008-01-14 18:42:30.000000000 -0800 @@ -328,6 +328,9 @@ function update_calculate_project_data($ $projects[$project]['reason'] = t('No available releases found'); continue; } + // Make sure we find the currently installed release, or we know our + // available update data is stale. + $found_current_release = FALSE; foreach ($available[$project]['releases'] as $version => $release) { // First, if this is the existing release, check a few conditions. if ($projects[$project]['existing_version'] == $version) { @@ -358,6 +361,7 @@ function update_calculate_project_data($ 'data' => t('Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'), ); } + $found_current_release = TRUE; } // Otherwise, ignore unpublished, insecure, or unsupported releases. @@ -418,7 +422,7 @@ function update_calculate_project_data($ } // Stop searching once we hit the currently installed version. - if ($projects[$project]['existing_version'] == $version) { + if ($found_current_release) { break; } @@ -446,6 +450,26 @@ function update_calculate_project_data($ } } + // If we were unable to find the currently installed release, we + // have bogus (probably just stale) available update data. + if (!$found_current_release) { + $projects[$project]['status'] = UPDATE_UNKNOWN; + $projects[$project]['reason'] = t('Current release not found'); + $projects[$project]['extra'][] = array( + 'class' => 'release-not-found', + 'label' => t('Unknown release'), + 'data' => t('The currently installed version of this project was not found in the list of available updates.'), + ); + // Unset everything we thought we knew about this, since it's bogus. + unset($projects[$project]['recommended']); + unset($projects[$project]['security updates']); + unset($projects[$project]['also']); + unset($projects[$project]['dev_version']); + unset($projects[$project]['latest_version']); + // TODO: clear the available update cache, too? + continue; + } + // If we were unable to find a recommended version, then make the latest // version the recommended version if possible. if (!isset($available[$project]['recommended']) && isset($available[$project]['latest_version'])) {