cvs [diff aborted]: no such directory `modules' cvs diff: Diffing modules/update_status Index: modules/update_status/update_status.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/update_status/update_status.module,v retrieving revision 1.60 diff -u -p -r1.60 update_status.module --- modules/update_status/update_status.module 21 Jun 2007 08:47:47 -0000 1.60 +++ modules/update_status/update_status.module 21 Jun 2007 11:45:28 -0000 @@ -24,12 +24,15 @@ function update_status_help($section) { case 'admin/logs/updates': return '
'. t('Here you can find information on the update status of your installed modules. Note that each module is part of a "project", which may have the same name as the module or may have a different name.') .'
'; case 'admin/build/modules': + include_once './includes/install.inc'; $status = update_status_requirements('runtime'); - if ($status['update_status']['severity'] == REQUIREMENT_ERROR) { - drupal_set_message(t('There are updates available for one or more of your modules. To ensure the security of your server, you should update immediately. See the !available_updates page for more information', array('!available_updates' => l(t('available updates'), 'admin/logs/updates'))), 'error'); - } - elseif ($status['update_status']['severity'] == REQUIREMENT_WARNING) { - drupal_set_message($status['update_status']['description']); + if (isset($status['update_status']['severity'])) { + if ($status['update_status']['severity'] == REQUIREMENT_ERROR) { + drupal_set_message(t('There are updates available for one or more of your modules. To ensure the security of your server, you should update immediately. See the !available_updates page for more information', array('!available_updates' => l(t('available updates'), 'admin/logs/updates'))), 'error'); + } + elseif ($status['update_status']['severity'] == REQUIREMENT_WARNING) { + drupal_set_message($status['update_status']['description']); + } } return ''. t('See the !available_updates page for information on any modules listed below that have newer versions released.', array('!available_updates' => l(t('available updates'), 'admin/logs/updates'))) .'
'; } @@ -112,11 +115,13 @@ function update_status_settings() { ); } - $options = array( - 'always' => t('Always'), - $project['recommended'] => t('Ignore @version', array('@version' => $project['recommended'])), - 'never' => t('Never'), - ); + $options = array(); + $options['always'] = t('Always'); + if (isset($project['recommended'])) { + $options[$project['recommended']] = t('Ignore @version', array('@version' => $project['recommended'])); + } + $options['never'] = t('Never'); + $form['projects'][$key]['check'] = array( '#type' => 'select', '#options' => $options, @@ -533,7 +538,8 @@ function update_status_calculate_project // Look for the 'recommended' version if we haven't found it yet (see // phpdoc at the top of this function for the definition). if (!isset($avail[$project]['recommended']) - && $release['version_major'] == $target_major) { + && $release['version_major'] == $target_major + && isset($release['version_patch'])) { if ($patch != $release['version_patch']) { $patch = $release['version_patch']; $version_patch_changed = $release['version']; @@ -557,8 +563,8 @@ function update_status_calculate_project } // If we were unable to find a recommended version, then make the latest - // version the recommended version. - if (!isset($avail[$project]['recommended'])) { + // version the recommended version if possible. + if (!isset($avail[$project]['recommended']) && isset($avail[$project]['latest_version'])) { $avail[$project]['recommended'] = $avail[$project]['latest_version']; } $projects[$project] += $avail[$project]; @@ -567,6 +573,14 @@ function update_status_calculate_project // Check to see if we need an update or not. // + // If we don't know what to recommend, there's nothing much we can + // report, so bail out early. + if (!isset($projects[$project]['recommended'])) { + $projects[$project]['status'] = UPDATE_STATUS_UNKNOWN; + $projects[$project]['reason'] = t('No available releases found'); + continue; + } + // First, see if we're not supposed to check due to settings. if (isset($settings[$project]) && isset($settings[$project]['check']) && ($settings[$project]['check'] == 'never' || @@ -591,7 +605,7 @@ function update_status_calculate_project case 'dev': $latest_version = $avail[$project]['releases'][$projects[$project]['latest_version']]; - if ($latest_version['version_extra'] == 'dev') { + if (isset($latest_version['version_extra']) && $latest_version['version_extra'] == 'dev') { if (empty($projects[$project]['datestamp'])) { $projects[$project]['status'] = UPDATE_STATUS_NOT_CHECKED; $projects[$project]['reason'] = t('No filedate available'); @@ -615,7 +629,7 @@ function update_status_calculate_project } else { $projects[$project]['status'] = UPDATE_STATUS_UNKNOWN; - $projects[$project]['reason'] = t('Missing info'); + $projects[$project]['reason'] = t('No available releases found'); } } return $projects; @@ -641,11 +655,6 @@ function theme_update_status_report($dat $rows = array(); foreach ($data as $project) { - // This protects us from homegrown projects that either aren't - // configured properly or don't actually have info on drupal.org. - if (!$project['title']) { - continue; - } switch ($project['status']) { case UPDATE_STATUS_NOT_CURRENT: $class = 'error'; @@ -683,7 +692,17 @@ function theme_update_status_report($dat $row .= "\n"; $row .= '| '. $tag ." | \n"; @@ -891,10 +912,14 @@ class update_status_xml_parser { break; case 'TERM': unset($this->current_object); - if (!is_array($this->current_release['terms'][$this->current_term['name']])) { - $this->current_release['terms'][$this->current_term['name']] = array(); + $term_name = $this->current_term['name']; + if (!isset($this->current_release['terms'])) { + $this->current_release['terms'] = array(); } - $this->current_release['terms'][$this->current_term['name']][] = $this->current_term['value']; + if (!isset($this->current_release['terms'][$term_name])) { + $this->current_release['terms'][$term_name] = array(); + } + $this->current_release['terms'][$term_name][] = $this->current_term['value']; break; case 'TERMS': $this->current_object = &$this->current_release; @@ -907,7 +932,13 @@ class update_status_xml_parser { function data($parser, $data) { if ($this->current_tag && !in_array($this->current_tag, array('PROJECT', 'RELEASE', 'RELEASES', 'TERM', 'TERMS'))) { - $this->current_object[strtolower($this->current_tag)] .= $data; + $tag = strtolower($this->current_tag); + if (isset($this->current_object[$tag])) { + $this->current_object[$tag] .= $data; + } + else { + $this->current_object[$tag] = $data; + } } } } cvs diff: Diffing modules/update_status/po