Problem/Motivation
locale_translation_clear_cache_projects()
tries to clear the the locale_translation_get_projects
drupal_static()
cache, but does so incorrectly.
This surfaces when installing Drupal via Drush in a different language. Initially the list of projects to install translations for contains only drupal
. When later importing translations for other projects, the now stale list is retrieved instead of recalculating the list of projects based on the modules that have been enabled as part of the installation.
When installing through the UI this does not surface because - as always - each installation step is performed in a separate request, thus, the static is irrelevant.
Proposed resolution
Call drupal_static_reset()
from locale_translation_clear_cache_projects()
.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#14 | 2361415-8-pass.patch | 2.39 KB | tstoeckler |
#8 | 2361415-8-test-only.patch | 1.87 KB | tstoeckler |
Comments
Comment #1
tstoecklerHere we go.
As usual, this whole code path is so convoluted that there is no way to write tests for this. :-/
I also wondered whether there is any value at all in the static, but let's fix the bleeding first.
Comment #3
tstoecklerToday is just not my day.
Comment #4
dawehnerMeh, I guess there is also no way to test that?
Comment #5
tstoecklerI genuinely thought about how to test this, but I have no clue whatsoever. I'm fairly certain it can't be done.
Comment #6
alexpottSurely this is testable by doing soemthing like
Comment #7
tstoecklerAhh, yes that would be possible. I thought about triggering the actual symptom described in the issue summary from within a test.
Yes, will write a little KernelTestBase.
Comment #8
tstoecklerHere we go.
Comment #10
Gábor HojtsyThe test looks great on a textual review. The bug is #facepalm.
Comment #11
alexpottCommitted 5dcc99f and pushed to 8.0.x. Thanks!
Comment #14
tstoecklerSo this got stuck on a testbot twice. Re-uploading to see if the same happens when it (hopefully) gets fetched by a different bot.
Comment #15
tstoecklerHey, that's nice! :-)
Comment #17
alexpottI confirmed that
Drupal\locale\Tests\LocaleTranslationProjectsTest
was green before committing and 1 liner was already green :)Comment #18
Gábor HojtsySuperb, thanks.