[MGNLDIFF-82] i18n aware comparison doesn't work in multisite environment Created: 23/Dec/14  Updated: 12/Jan/15  Resolved: 05/Jan/15

Status: Closed
Project: Magnolia Diff Module
Component/s: None
Affects Version/s: 1.6.1
Fix Version/s: 1.6.2

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
clones MGNLDIFF-80 i18n aware comparison doesn't work in... Closed
Relates
relates to MGNLDIFF-74 Diff module is not i18n aware on sing... Closed
dependency
depends upon MULTISITE-34 MultiSiteManager#getAssignedSite alwa... 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-74. But there is problem with multisite environment.

The problem is that 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 'handle' instead of '/fr/handle').

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 Locale}}s collection for the {{default site!

Suggested solution

Put correct Site on the AggregationState in VersionDiffHTMLServlet.

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 Philip Mundt [ 23/Dec/14 ]

Please note this fix can't be backported to fixVersion 1.5.x as the underlying fix from MGNLDIFF-74 was not backported.

Comment by Philip Mundt [ 05/Jan/15 ]

There is an issue with the comparison when the Locale definition specifies a country, i.e. fr_CH won't work.

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