Problem/Motivation
The translations directory locations is currently locked to $site_path . '/files/translation' during site installation (in install_check_translations()).
Proposed resolution
This changes makes it configurable like it is already done in install_begin_request() (same file line 429).
I have marked the issue as a feature request but one could argue it's almost a bug because it was already made configurable in other parts of the install process :-)
Remaining tasks
- create MRs and functional test (or extend some)
- decide about option for quichinstall of core, related to #3089277: Provide core CLI commands for the most common features of Drush
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #38 | 2950407-nr-bot.txt | 3.04 KB | needs-review-queue-bot |
| #36 | 2950407-nr-bot.txt | 2.36 KB | needs-review-queue-bot |
Issue fork drupal-2950407
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
arnested commentedComment #3
arnested commentedComment #5
casey commentedThe patch still seems to be working just fine.
Comment #10
tstoecklerThanks @arnested and @casey for opening and reviewing this issue!
This is still a problem. I am coming from #2625820: install_check_translations() sometimes incorrectly returns NULL instead of array and found this issue now. The patch in #2 works fine, I just think we can do a bit better:
install_begin_request()I think it makes more sense to "store" it in the install state and just re-use it from there. Instead of just adding a third argument toinstall_check_translations()for this purpose I think it is better to just pass the$install_stateentirely. That will also allow further fixes in the future; I am for example interested in makinginstall_check_translations()aware of the configured translation filename pattern.I created a merge request that does exactly that. I added a draft change notice for the parameter change in
install_check_translations()and added a basic test. I was not able to add a legacy test for the parameter deprecation becauseinstall_check_translations()performs HTTP requests, so I hit #2571475: Outbound HTTP requests fail with KernelTestBase. The only way to avoid the HTTP request is the early return that will be removed by #2625820: install_check_translations() sometimes incorrectly returns NULL instead of array so I don't think it makes much sense to exploit that here.I am also not providing a "tests-only" patch because that triggers #3158071: Redirect loop during installation with non-English so it could possibly crash the test boot due to an infinite loop. I will comment there about my findings in regards to that.
One further note: Instead of adding yet another entry to
$install_stateI considered something like a generaltranslation_configkey in anticipation of further related keys, such as the filename pattern noted above. However, we already have the'server_pattern'key which should then go under that, as well, but we currently have no way of deprecating a key there. Also it might also make sense to provide some more generic integration between$install_stateand$configfromsettings.php, but I wouldn't want to hold this up on that. So for now I think yet another key is the least bad option.Comment #11
tstoecklerOh and I didn't provide an interdiff to #2 because it's almost identical to the patch itself, so it wouldn't be of much use.
Comment #12
tstoecklerOpened #3182660: [PP-1] Make translation filename pattern configurable during install for the follow-up issue regarding the filenames. I will base that one on this.
Comment #13
tstoecklerSee #3182697: ComposerIntegrationTest fails under Merge request testing for the remaining test failure. This should be good for reviews, as far as I can tell.
Comment #14
tstoecklerHere's a 8.9.x patch. Not sure if this has a change of being backported, so not running the tests as of now.
Comment #15
alexpottThis doesn't apply to 9.1.x or 9.2.x so needs to be re-rolled. The solution might need a tweak since #3181644: PCRE library version 10.35 with pcre.jit=1 makes \Drupal\Core\StringTranslation\Translator\FileTranslation::getTranslationFilesPattern() regex misbehave has landed.
Comment #16
tstoecklerComment #18
timohuismanWe use composer patches to apply patches. Merge request patch urls are updated for every commit on the branch, which makes it a moving target. Attached is a patch containing the current state of the merge request (https://git.drupalcode.org/project/drupal/-/merge_requests/37.patch).
Comment #22
smustgrave commented@alexpott there are some open threads if you could take a look.
Comment #23
smustgrave commentedFor open threads in MR
Comment #25
arnested commentedReroll.
Comment #26
andypostpatches are no longer used to run tests, please update MR or create new one
Comment #28
arnested commentedI was about o, but got distracted. Pushed now.
Comment #29
andypostPolished IS a bit but it needs more clean-up especially for CLI
Comment #30
andypostComment #31
andypostproper state as test added
Comment #32
andypostas the function argument changed issue needs change record
Comment #33
arnested commented@tstoeckler already added a change record: https://www.drupal.org/node/3182651
Comment #34
smustgrave commentedCR appears to be written and IS updated so removing those tags.
Comment #35
timohuismanThe https://git.drupalcode.org/project/drupal/-/merge_requests/8742 is still applicable, but because it's a moving target we prefer a patch as snapshot of the MR.
Comment #36
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #37
casey commentedRebased MR.
Attached snapshot of latest state of MR for safe usage with composer patches.
Comment #38
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.