[MULTISITE-86] Site not matched correctly if page and locale are equal Created: 07/Mar/18  Updated: 08/Dec/22  Resolved: 08/Aug/18

Status: Closed
Project: Magnolia Multisite Module
Component/s: None
Affects Version/s: 1.3.2
Fix Version/s: 1.2.21, 1.3.5

Type: Bug Priority: Neutral
Reporter: Pierre Sandrin Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia EE Pro 5.6.3


Attachments: Java Source File NotEmptyUriPrefixMatcher.java     XML File config.modules.multisite.config.rules.xml     XML File config.modules.multisite.config.sites.xml     JPEG File page-tree.jpg    
Issue Links:
Problem/Incident
duplicate
is duplicated by MULTISITE-87 Recent changes to NotEmptyUriPrefixMa... Closed
relation
is related to MULTISITE-90 Recent changes to NotEmptyUriPrefixMa... Open
Template:
Patch included:
Yes
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:
Epic Link: Support
Sprint: Kromeriz 148, Kromeriz 149, Kromeriz 150, Kromeriz 152, Kromeriz 157, Kromeriz 158
Story Points: 13

 Description   

We found that the Multisite rule "uri-prefix-not-empty" did not match correctly the multisite definition. The same configuration works for 5.6.1 but not in 5.6.3.

I attached the multisite configuration and the page tree screenshot.

The problem was that the page "/de" was not reachable and producing 404 because "unibas-newsletter" site definition was mached instead of "fallback".

The Problem is linked to the page having the same name than the locale ("de")

I fixed the issue by modifying the Class NotEMptyUriPrefixMatcher. (see attachment, Class and rules config)



 Comments   
Comment by Antti Hietala [ 18/May/18 ]

pierre, when you define locales in your site definition, the default class that implements I18nContentSupport is info.magnolia.cms.i18n.DefaultI18nContentSupport which assumes that a language prefix such as en is passed in the URL. This means that you cannot have site roots (or pages names at all) that match the locale (en, de, fr etc.). In your case, you have site roots named after locales (multiple trees strategy).

You should be using HierarchyBasedI18nContentSupport or RequestLocaleAwareI18nContentSupport or a custom implementation of I18nContentSupport. See https://documentation.magnolia-cms.com/display/DOCS56/Language+configuration#Languageconfiguration-3.Definelocalesinsite

On our part, we will make this clearer in documentation as it is indeed easy to overlook.

Comment by Pierre Sandrin [ 31/May/18 ]

Dear Anttti, we have HierarchyBasedI18nContentSupport configured in the respective site definition. So that is not the Problem.

But I am happy to see that the Problem identified and will hopefully be fixed with 5.6.7

 

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