[MAGNOLIA-6458] I18N mechanism issue: ChildDecorator modifies original definition list fields Created: 09/Dec/15 Updated: 20/Jul/16 Resolved: 07/Apr/16 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | i18n |
| Affects Version/s: | 5.4.3 |
| Fix Version/s: | 5.4.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Aleksandr Pchelintcev | Assignee: | Roman Kovařík |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | i18n, support | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 1.25h | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: | |
| Sprint: | Kromeriz 38 |
| Story Points: | 2 |
| Description |
|
For some reasons (most likely 'pre-mature optimisation') ChildDecorator handles Lists differently from maps and other types of collections: instead of creating an immutable copy of a list filled with proxied elements - an original collection elements are replaced with proxies => the state of the 'singleton' definition re-used by all the users of the webapp is modified. As of f6ec736175f156c6081e0b58c2b7f8ee763c3462 it causes problems with translating the definitions that have list fields for users with different locales: original def gets partially i18n-proxied forever and gets stuck with a same LocaleProvider. Video demonstrating the issue: https://nas.lemonize.de:5001/fbsharing/DVjgi2Xn |
| Comments |
| Comment by Aleksandr Pchelintcev [ 16/Dec/15 ] |
|
NOTE that the patch provided isn't entirely correct since it produces the immutable maps which might break some functionality that relies on mutability of the lists (i.e. MoveDialogPresenter modifies the tabular view's column lists, adds and removes elements). In fact - those assumptions are bad and definitions in general case MUST be immutable, but for now I propose that the lists produced by ChildDecorator are actually mutable (e.g. wrap a resulting list into Lists.newLinkedList(immutableVersion)). |
| Comment by Vivian Steller [ 03/Feb/16 ] |
|
Hi folks, The patch that Jan provided works great (tested in production). For each and every release we have to recompile magnolia-i18n to keep this patch which is really annoying. Thanks a lot, Vivian |