[MAGNOLIA-7614] VirtualURIMappings are not locale aware -> not usable in combination with content-i18n mechanism Created: 02/Sep/19  Updated: 26/Nov/19

Status: Open
Project: Magnolia
Component/s: Virtual URI mappings
Affects Version/s: 5.6.10, 5.7.4, 6.0, 6.1.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File LocaleAndSiteAwareRegexpVirtualUriMapping.java    
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
Date of First Response:

 Description   

Situation:

  • Using OTB content-i18n mechanism
  • Having content on website, and in content apps translated.
  • Trying to achieve a dynamic page that redirects nice URL's to itself alike this example:
    • fromUri /products/([0-9a-zA-Z-]+)\.html
    • toUri forward:/product/detail.html?productId=$1
  • On that dynamic page content should be rendered i18n-ized fetched from the content app (or any other system).
  • Also this should work on redirects and permanent redirects.

Problem 1: Local information ist lost.

=> This can NOT work!! Because the information of the local is lost on the forward/redirect/permanent.

 

Problem 2: The site information (in the URL) is lost

=> This can ONLY work on public instances with domain mapping!! 
Because the information of the siteDefintion's name in the URL is lost on the redirect/permanent.

The current pattern of VirtualUriMapping in the scope of redirect&permanent will only work on public instances with a domain mapping. On author it won't work at all, as the site defintion-name ist lost in the url.

 

Solution / Workaround

Use the patched class.

Be aware that it provides two additional configuration values (default is false):

useLocale: true

useSiteDefinition: true

Without enabling them the Mapping behaves 1:1 as the original/OTB RegexpVirtualUriMapping class.

 Attention: This class is a work around/poc, it has not been tested in all possible complex multisite environments.



 Comments   
Comment by Christian Ringele [ 03/Sep/19 ]

Findings non light development mode:

1. Placing before 'i18n' filter:
=====================
On forward:
-----------
Works:

  • On domain mapping (public): Local is "transferred"
  • Non domain mappings (author): Local & SiteDef is "transferred"

On redirects:
-----------
Works:

  • On domain mapping (public): Local is "transferred"
    Does not work:
  • Non domain mappings (author): SiteDef is lost, Local & is "transferred"

2. Placing before 'multisite' filter:
========================
On forward:
-----------
Works:

  • On domain mapping (public): Local is "transferred"
  • Non domain mappings (author): Local & SiteDef is "transferred"

On redirects:
-----------
Works:

  • On domain mapping (public): Local is "transferred"
  • Non domain mappings (author): Local & SiteDef is "transferred"
Comment by Pierre Sandrin [ 26/Nov/19 ]

We are using a Solution (Custom class) based on Matteo Pelucco's code to solve the problem in a multilingual environment (no multisite):

(http://maips21.altervista.org/wordpress/2015/05/05/how-to-build-a-locale-aware-virtualurimapping-in-magnolia-with-regexp/)

Generated at Mon Feb 12 04:25:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.