commit 9dcbe8760312b057be54526fbda0390874db412e Author: Erik Stielstra Date: Sat Sep 26 11:18:50 2015 +0200 1832946-locale-update.75.patch diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc index 661291e..092e989 100644 --- a/core/modules/locale/locale.compare.inc +++ b/core/modules/locale/locale.compare.inc @@ -52,17 +52,18 @@ function locale_translation_build_projects() { $default_server = locale_translation_default_translation_server(); - // If project is a dev release, or core, find the latest available release. foreach ($projects as $name => $data) { // For dev releases, remove the '-dev' part and trust the translation server // to fall back to the latest stable release for that branch. - if (preg_match("/^(\d+\.x-\d+\.)[x|\d+]-(dev|alpha|beta).*$/", $data['info']['version'], $matches)) { - // Example matches: 8.x-1.x-dev, 8.x-1.0-alpha1 => 8.x-1.x - $data['info']['version'] = $matches[1] . 'x'; - } - elseif (preg_match("/^(\d+\.\d+\.)\d+.*$/", $data['info']['version'], $matches)) { - // Example match: 8.0.0-dev => 8.0.x (Drupal core) - $data['info']['version'] = $matches[1] . 'x'; + if (isset($data['info']['version']) && strpos($data['info']['version'], '-dev')) { + if (preg_match("/^(\d+\.x-\d+\.).*$/", $data['info']['version'], $matches)) { + // Example matches: 8.x-1.x-dev, 8.x-1.0-alpha1+5-dev => 8.x-1.x + $data['info']['version'] = $matches[1] . 'x'; + } + elseif (preg_match("/^(\d+\.\d+\.).*$/", $data['info']['version'], $matches)) { + // Example match: 8.0.0-dev => 8.0.x (Drupal core) + $data['info']['version'] = $matches[1] . 'x'; + } } // For every project store information.