[MGNLETK-57] ETKSiteManager in use with domain mappings: should return currentSite if no explicit repository mapping was detected. Created: 26/May/11  Updated: 23/Aug/11  Resolved: 17/Aug/11

Status: Closed
Project: Extended Templating Kit (closed)
Component/s: multisite
Affects Version/s: 1.4.2
Fix Version/s: 1.4.3

Type: Bug Priority: Critical
Reporter: Christian Ringele Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File ETKSiteManager.java.patch     PNG File LogoURL.png    
Issue Links:
causality
caused by MGNLETK-49 when creating links use the current s... Closed
relation
is related to MGNLETK-31 multisite: wrong links created if the... Closed
is related to MGNLETK-59 site mapping: don't ignore the uri pr... Closed
supersession
is superseded by MGNLETK-62 multisite detection: implement a rule... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

Situation:
The STK homepage defines the logo and the print logo. In demo project they are chosen from DMS.
When accessing the demo by the mapped domain name (http://demo-project-author.magnolia-cms.com/), the logo is not displayed anymore.
The code starting point is the call getAssetLink(content, nodeDataPrefix, DAMSupport.VARIATION_ORIGINAL);
So it will serve the image directly from DMS and not from the imaging repo/module.

when looking at the rendered URL, it created an external link based on the defaultBaseURL, see print screen.

Cause:
1. No specific DMS mapping is defined for any site -> the ETKSiteManager falls back to default (instead of current)
2. default site has no domain mapping -> fallback to the DomainNamePathTransformer which uses the defaultBaseURL

Correction:
When no explicit repository mapping in a siteDefinition can be detected, it means that the 'requested' content belongs to all. So the ETKSiteManager should return the current-site and not the default-site.
(Included draft patch created together with Philipp)



 Comments   
Comment by Christian Ringele [ 26/May/11 ]

Was created by solving ETK-49

Comment by Christian Ringele [ 26/May/11 ]

Added better draft patch, old patch was not very smart.

Comment by Jan Haderka [ 26/May/11 ]

The way i read this patch it will solve the problem for global resources such as dms content, but at a same time it breaks all the global website content which doesn't belong to any site (such as custom 404 pages, etc.) since with the patch Magnolia will try to read it from the current site and either fetch wrong content or end up with 404.
Might be better to write and attach test case exposing the problem then half baked patch

Comment by Christian Ringele [ 26/May/11 ]

That is right, don't use this patch, was just a quick draft.
I'll add a test case next time.

Comment by Philipp Bärfuss [ 27/May/11 ]

There is actually a working workaround:

  • add an explicit mapping even for the root pathes (dms --> /)
  • make sure you add it to all the sites

The mechanism is then accepting the current site as wished.

Comment by Philipp Bärfuss [ 27/May/11 ]

A better fix might not only iterate on the direct mappings but also on the indirect ones (the mappings in the central uri mapping). If done so we don't have to change the algorithm.

Comment by Philipp Bärfuss [ 29/Jun/11 ]

Scheduling this issue for the next bug fix release. We know how to fix it.

Comment by Philipp Bärfuss [ 23/Aug/11 ]

Will finally be solved by a new algorithm (MGNLETK-62).

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