Gabor,

function l10n_drupalorg_scan($automated = FALSE) (l10n_drupalorg.admin.inc, line 44) scan the last release of a given project. but not only the release might not be the lastest one (it should prioritize D6 than scan D5 right?) but also the release might be already scanned. This slightly modified version corrects these 2 mistakes. Its +- 7 lines changed.

function l10n_drupalorg_scan($automated = FALSE) {
  include_once 'projects.inc';
  include_once drupal_get_path('module', 'l10n_community') .'/extractor.inc';

  // Always update full project list.
  l10n_drupalorg_sync_projects();

  // Pick the projects we did not update for the longest period and sync fresh release list.
  $scanned = variable_get('l10n_drupalorg_limit', 1);
  $result1 = db_query("SELECT * FROM {l10n_community_project} WHERE connector_module = 'l10n_drupalorg' AND status = 1 ORDER BY last_parsed ASC");
  while ($project = db_fetch_object($result1) and $scanned) {
    l10n_drupalorg_sync_releases($project);

    // Pick the release we did not update for the longest period, and sync the tarball.
    // We should only look for releases with downloads. Placeholder releases for later
    // versions should not be considered.
    if ($release = db_fetch_object(db_query_range("SELECT r.* FROM {l10n_community_project} p LEFT JOIN {l10n_community_release} r ON p.pid = r.pid WHERE r.last_parsed = 0 AND p.pid = %d AND r.download_link != '' ORDER BY r.title DESC", $project->pid, 0, 1))) {
      $scanned--;
      $result = l10n_drupalorg_sync_files($release);

      if (!$automated) {
        // User feedback, if not automated. Log messages are already done.
        if (isset($result['error'])) {
          drupal_set_message($result['error'], 'error');
        }
        if (isset($result['message'])) {
          drupal_set_message($result['message']);
        }
      }
    }
  }

  // Ensure that a Drupal page will be displayed with the messages.
  return '';
}

regards,

massa

Comments

brmassa’s picture

Note: it includes thefix presented on #546754: fetch_object frequent error

meba’s picture

Status: Needs review » Needs work

Massa,

please include a patch, not a changed function.

gábor hojtsy’s picture

Status: Needs work » Closed (won't fix)

l10n_drupalorg is discontinued.