Problem/Motivation

When not the latest version of core is installed, the translation update system will download and import translation of the latest drupal core version. This behaviour only applies to core and not to contributed modules. This may cause confusion when the translation version is compared to the version of the installed core release.
As a side effect the test scripts which test the translation update code, must do additional effort to ignore the core release. Since the test scripts can be run with various core versions (currently 8.x-dev, but in the future 8.-RC1, 8.0, etc.) this unstable factor must be eliminated. The above behaviour makes this elimitation more complicated, as was discussed in #1998056: Automatically update interface translations using cron #26.

This problem has been reported before in the Drupal 7 branch of Localization Update module. See #1883154: Check version before update

Proposed resolution

Remove a piece of code which always applies the latest core release version to the core project.

Remaining tasks

none

User interface changes

none

API changes

none

#1998056: Automatically update interface translations using cron

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sutharsan’s picture

Status: Active » Needs review
FileSize
1.76 KB

This patch fixes the problem.

Gábor Hojtsy’s picture

Issue tags: +language-ui

Why was this code added in the first place? Was it a temporary need? What made us not need it anymore?

Sutharsan’s picture

I don't know why it was added, it was added to l10n_update in #1001554: Make it possible to fetch .po files for dev modules/core. Introduced in #42.
It changed (#40):

+ if (preg_match("/([0-9]+).x-dev/", $data['info']['version'], $matches)) {
...
+ }
+ // Find out if it's coming right out of HEAD
+ if (preg_match("/HEAD/", $data['info']['version'], $matches)) {
+ // Get the last available release
+ $release = array_shift($projects_info[$name]['releases']);
+ }

into (#42):
+ if (preg_match("/^[6-9].x-([0-9]+)\..*-dev$/", $data['info']['version'], $matches)) {
...
+ }
+ elseif ($name == "drupal" || preg_match("/HEAD/", $data['info']['version'], $matches)) {
+ // Pick latest available release.
+ $release = array_shift($projects_info[$name]['releases']);
+ }
I am puzzled by this change. There is hardly any description of this change:

... inability to deal with version strings generated from git_deploy module (like 7.x-3.0-rc1.16-dev) and not handling core translations.

It was removed from l10n_update in #1883154: Check version before update after the observation:

For example I am currently using Drupal version 7.17, but when I check for translation updates, there is a translation for core Drupal version 7.18.

Gábor Hojtsy’s picture

Title: Core translation update » Core should not force latest version number translations on sites
Status: Needs review » Reviewed & tested by the community

All right, well, looks entirely logical to remove :)

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.