From 9058a8984d76ae238bdc3a45a1c41dfa9012445c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 13 Oct 2009 02:14:05 +0000 Subject: - Patch #597484 by dww: use the Queue API to fetch available update data. --- modules/update/update.compare.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'modules/update/update.compare.inc') diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc index db216d7cf..389c30d76 100644 --- a/modules/update/update.compare.inc +++ b/modules/update/update.compare.inc @@ -406,7 +406,7 @@ function update_calculate_project_data($available) { break; case 'not-fetched': $projects[$project]['status'] = UPDATE_NOT_FETCHED; - $projects[$project]['reason'] = t('Failed to fetch available update data'); + $projects[$project]['reason'] = t('Failed to get available update data.'); break; default: @@ -469,6 +469,17 @@ function update_calculate_project_data($available) { $version_patch_changed = ''; $patch = ''; + // If the project is marked as UPDATE_FETCH_PENDING, it means that the + // data we currently have (if any) is stale, and we've got a task queued + // up to (re)fetch the data. In that case, we mark it as such, merge in + // whatever data we have (e.g. project title and link), and move on. + if (!empty($available[$project]['fetch_status']) && $available[$project]['fetch_status'] == UPDATE_FETCH_PENDING) { + $projects[$project]['status'] = UPDATE_FETCH_PENDING; + $projects[$project]['reason'] = t('No available update data'); + $projects[$project] += $available[$project]; + continue; + } + // Defend ourselves from XML history files that contain no releases. if (empty($available[$project]['releases'])) { $projects[$project]['status'] = UPDATE_UNKNOWN; -- cgit v1.2.3