Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
15.0
-
None
-
Unknown
-
Description
Steps to reproduce
Compute the view URL of a Document located in a subwiki, by executing the code below in a JSX:
const reference = XWiki.Model.resolve('WebHome', XWiki.EntityType.DOCUMENT, ['mywiki', 'Sandbox']); const page = new XWiki.Document(reference); console.log('View URL', page.getURL()); console.log('REST URL', page.getRestURL());
Actual result
The printed view URL points at the main wiki: /xwiki/bin/view/Sandbox/WebHome, while an URL taking account the passed subwiki is expected.
The printed REST view URL is, as expected, /xwiki/rest/wikis/mywiki/spaces/Sandbox/pages/WebHome. It's however more difficult to compute the view URL than the REST one since the former depends whether the multiwiki configuration is set to domain based or path based.