Problem/Motivation
#3218674: "Translation file not found" for English when "translate_english" is false stopped the remote check for English translation files when the remote URI uses the default server pattern. drupal.org does not provide English translations, so every request returns 404.
#3577671: Modernize locale file handling changed the status check. The HTTP request now occurs before the $failure check. The flag only prevents that the result is saved. Thus Drupal sends a HEAD request for each project again and logs a notice for each 404:
[notice] Translation file not found: https://ftp.drupal.org/files/translations/all/views_bulk_operations/views_bulk_operations-4.4.9.en.po.
Affected code in LocaleFetch::batchStatusCheck():
$remoteFileInfo = $this->localeFileManager->checkRemoteFileStatus($remote_file->uri);
if (!$failure && $remoteFileInfo->status !== RemoteFileStatus::Error) {The test LocaleBatchTest::testEnglishTranslationSkipsDefaultPattern() did not detect the regression. It only checks that the project is in failed_files. A 404 response gives the same result.
The affected code is the same in main, 12.0.x, 11.x and 11.4.x.
Steps to reproduce
- Install Drupal 11.4.x with the Locale module and English as a language. Keep "Enable interface translation to English" disabled.
- Add contributed modules, or check for translation updates.
- Look at the recent log messages. There is one "Translation file not found" notice for each project with an
.en.poURI.
Proposed resolution
- Do not call
checkRemoteFileStatus()when$failureis TRUE. - Extend the kernel test: mock
LocaleFileManagerand make sure thatcheckRemoteFileStatus()is not called for English with the default server pattern.
MR !16906 in #3619842: Translation install and update batch does a HEAD and then a GET request for every project unnecessarily contains the same change as part of a larger task. This issue fixes the regression separately so that the fix can be backported.
Remaining tasks
Create a MR against main.- Review.
- Cherry-pick to 12.0.x, 11.x and 11.4.x.
User interface changes
None.
Introduced terminology
None.
API changes
None.
Data model changes
None.
Release notes snippet
None.
Issue fork drupal-3631576
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
tobiasbComment #4
tobiasbComment #5
tobiasb