If you open a Launch of an AEM page, the SiteRoot.getRootPath() returns the wrong path.
Steps to reproduce:
Site to site admin, select a page with a Launch (e.g. a page in a translation project)
In the side panel go to References > Launches, select a launch and click on "Go to the Page"
The page is being called in edit mode like
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
we have already utility methods dealing with the specialties of launches and version history path
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.
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
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:
great. I merged the branch into develop.