[MGNLDIFF-80] i18n aware comparison doesn't work in multisite environment Created: 18/Aug/14  Updated: 23/Dec/14  Resolved: 18/Dec/14

Status: Closed
Project: Magnolia Diff Module
Component/s: None
Affects Version/s: 1.2.2
Fix Version/s: 1.2.4

Type: Bug Priority: Major
Reporter: Zarko Ivanoski Assignee: Philip Mundt
Resolution: Fixed Votes: 0
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLDIFF-82 i18n aware comparison doesn't work in... Closed
dependency
depends upon MGNLETK-129 ETKSiteManager#getAssignedSite always... Closed
relation
is related to MGNLDIFF-70 Diff module is not i18n aware on sing... Closed
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
Release notes required:
Yes
Date of First Response:
Visible to:
Marcel Stör

 Description   

This feature was implemented with MGNLDIFF-70. But there is problem with multisite environment.

DiffLink.getLocales() always return locales from default site because storageNode path start with "/activation/..." and not with actual site prefix.

Instead getOriginalContent() should be used to aquire the proper node.

To Reproduce:

  • In demo-features site, enable i18n
  • Add an additional locale, fr. (This is important because the problem only shows up when the locale is something that is not present in Default site definition.)
  • Edit Page /demo-features/content-templates/article, Edit the title of the "Page Header" component.
    • Make the english version 'Article EN 1', make the french version 'Article FR 1'.
  • Publish the change & Go to the Inbox and Approve the workitem.
  • Edit the page again
    • Make the english version 'Article EN 2'. make the french version 'Article FR 2'.
  • Publish the change.
  • Go to the inbox, double click on the workitem, you'll see links at the bottom to Compare for each language.
  • You'll see that English works correctly, but that French shows the English changes too!


 Comments   
Comment by Zarko Ivanoski [ 12/Nov/14 ]

Issue is not fix-ed yet. Only links that are rendered in dialog now are aware of current site and configured locales.

But actual comparison still doesn't work. When you will click on the link and "/.magnolia/versionDiff" is opened, site is not resolved and default site is used.

Comment by Christopher Zimmermann [ 17/Dec/14 ]

The problem in the DIFF module is VersionDiffHtmlServlet#getVersionSource is generating the default language url (english) rather than the correct url for the locale - one that is prefixed with the locale - (just 'mysite' instead of '/fr/mysite').

This happens because i18nContentSupport.toI18NURI(NodeUtil.getPathIfPossible(node)); is returning the wrong URL - and this is because the actual site is not set on the AggregationState and so AbstractI18nContentSupport.isLocaleSupported() returns false for french. Because french is indeed not in the locales collection for the Default site!

Suggested solution is to put correct Site on the AggregationState in VersionDiffHTMLServlet.


  • Note, that once this is fixed the URL will be correct - but a problem in the linked ticket causes the browser to display a 404.
Comment by Christopher Zimmermann [ 17/Dec/14 ]

VersionDiffHtmlServlet#getVersionSource now sets the correct site on the AggregationState so that proper i18n uri's will be returned by i18nContentSupport.toI18NURI().

Comment by Philip Mundt [ 18/Dec/14 ]

Locales should only be returned when I18nContentSupport of info.magnolia.module.templatingkit.sites.Site is enabled.

Comment by Christopher Zimmermann [ 18/Dec/14 ]

Please see improvement on Branch MGNLDIFF-80-Country to support locale's with countries specified. (for example fr_FR and fr_CH)

Comment by Philip Mundt [ 23/Dec/14 ]

Removed fixVersions 1.6.2 and 1.5.5.

For fix on 1.6.x refer to MGNLDIFF-82.

1.5.x will not see the fix as the underlying i18n-ization (see MGNLDIFF-74) was not back-/up-ported.

Generated at Mon Feb 12 05:21:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.