Updated: Comment #7
Problem/Motivation
Static cache for language_list() is not cleared in _locale_rebuild_js()
Proposed resolution
The patch attached may work. However the file it is applied to no longer exists. A new patch should be created to work on the same function, which now lives in locale.module
Remaining tasks
The patch needs to be recreated for the proper file and tested
User interface changes
n/a
API changes
n/a
Related Issues
#1260510: Introduce a language_load($langcode)
Original report
There's a comment about consistency in runtime and database but we have a static cache for language_list() that is not cleared...
I found it working on #1260510: Introduce a language_load($langcode)
But suppose it should be fixed and backported to D7
Comment | File | Size | Author |
---|---|---|---|
#17 | drupal8_static_cache-1261212-17.patch | 2.1 KB | stefank |
#17 | drupal8_static_cache_test_only-1261212-17.patch | 1.56 KB | stefank |
#15 | drupal8_static_cache-1261212-15.patch | 2.13 KB | stefank |
#12 | drupal8_static_cache_simpletest-1261212-11.patch | 1.63 KB | piyuesh23 |
#10 | drupal8-static_cache_reroll-1261212-10.patch | 550 bytes | pwieck |
Comments
Comment #2
webchickFixing tag.
Comment #3
Gábor HojtsyAdding UI language translation tag.
Comment #4
andypostCurrently the logic here changed - language_delete call for invalidation (deferred clean-up), but actual _locale_rebuild_js() is used language_list() so deleted language files seems get's lost
so needs testing
Comment #5
YesCT CreditAttribution: YesCT commentedProbably needs a reroll.
Tests might be able to be written, even if a fix is not obvious.
An issue summary update using the issue summary template, and remaining tasks, might help.
#1260510: Introduce a language_load($langcode) might be useful to write steps to reproduce.
Comment #6
xjmComment #7
andypostprobably this could be covered with unittest
Comment #8
KRaisor CreditAttribution: KRaisor commentedPatch re-rolled as the code has been significantly re-factored.
Comment #10
pwieck CreditAttribution: pwieck commentedre-rolled with current head
Comment #11
pwieck CreditAttribution: pwieck commented#10 passed and ready for review.
Comment #12
piyuesh23 CreditAttribution: piyuesh23 commentedAttaching a simpletest written to test this case.
Comment #13
piyuesh23 CreditAttribution: piyuesh23 commentedComment #13.0
piyuesh23 CreditAttribution: piyuesh23 commentedAdding summary template
Comment #14
jhedstromThe fix from #10 and the test from #12 should be in a single patch. It's also odd that the test passes without the fix.
Comment #15
stefank CreditAttribution: stefank commentedHere is a patch with the fix and the test.
Comment #16
andypost@stefank please file a separate patch without fix (test only) to make sure that the test covers the bug.
Also 2 nitpicks, check another tests to format class properly
needs empty line
Comment #17
stefank CreditAttribution: stefank commentedThanks @andypost.
I've corrected the format, but Im still not sure about the text- if it does make sense.
Comment #18
Gábor HojtsyDoes this do anything anymore? language_list is just a deprecated wrapper now for the language manager. That does have an internal cache that could be reset, but this static reset will not do that right? So looks like the bug is gone, no? That the test only patch passes supports that too :)
Comment #19
andypostYep, seems only d7 affected now or test is outdated
Comment #20
jhedstromMoving to 7 based on #19 and #18.