Support SiteRoot in Launches

Description

If you open a Launch of an AEM page, the SiteRoot.getRootPath() returns the wrong path.

Steps to reproduce:

  1. Site to site admin, select a page with a Launch (e.g. a page in a translation project)

  2. In the side panel go to References > Launches, select a launch and click on "Go to the Page"

  3. The page is being called in edit mode like
    http://localhost:4502/editor.html/content/launches/2018/10/16/translation_review2/content/brand/en/page.html

  4. Every component which uses the SiteRoot model (e.g. the main navigation) throws an NPE, because the node at site root level is one of the nt:Folders "launches/2018/10/16" which cannot be adapted to a page

The SiteRoot should use the original root path, when is called from a Launch page

Activity

Show:
Stefan Seifert
October 19, 2018, 7:08 PM

we have already utility methods dealing with the specialties of launches and version history path
https://github.com/wcm-io/wcm-io-wcm/blob/develop/commons/src/main/java/io/wcm/wcm/commons/util/Path.java

they are used in context-aware configuration extensions, i'm currently not sure if they are also already correctly respected in the handler site root detection (although this is based on caconfig).

make sure to use the latest releases of wcm.io wcm commons and caconfig extensions.

Masoud Rozati
October 19, 2018, 7:15 PM

yes it is considered while calculating site root level, but not when getting site root path.
I think the fix would be something as simple as this
https://github.com/mrozati/wcm-io-handler/commit/614ea262ab948827ad9242cbb458b9157ff4e834

Stefan Seifert
October 19, 2018, 8:38 PM

this is a good approach - but in my opinion the behavior should be different:
the site root should be within the launch (or the version history), but on the correct position (this was wrong before).

based on your commit i created a feature branch and changed the code accordingly:
https://github.com/wcm-io/wcm-io-handler/tree/feature/WHAN-22-siteroot-launch

Masoud Rozati
October 22, 2018, 12:22 PM

great. I merged the branch into develop.
thanks

Fixed

Assignee

Unassigned

Reporter

Masoud Rozati

Labels

None

Components

Fix versions

Priority

Major