Details
-
Bug
-
Resolution: Unresolved
-
Major
-
7.2-milestone-3
-
Unknown
-
Description
Steps to reproduce
- Open the Copy (or Rename / Create) form of a page
- In the location picker, type in the parent field a space reference that includes the wiki, e.g. xwiki:Space.Target
Expected
The location preview (breadcrumb) shows the Space > Target location in the xwiki wiki, and nothing is logged.
Actual
The location preview is computed for a reference whose wiki is xwiki:xwiki, and errors are logged on the server, e.g.:
ERROR ghtCheckerAuthorizationManager - Failed to load rights for user [xwiki:XWiki.CopyRightsUser] on [Space xwiki:xwiki:NestedCopyPageIT]. org.xwiki.security.authorization.AuthorizationException: Could not retrieve the document to check security access when checking access to [xwiki:xwiki:XWiki.XWikiPreferences] Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: No wiki with id [xwiki:xwiki] could be found
and
ERROR c.x.x.d.XWikiDocument - Error when loading document [xwiki:xwiki:CopyWithChildrenTarget.WebHome] for locale [en] Caused by: com.xpn.xwiki.XWikiException: Error number 2 in 0: No wiki with id [xwiki:xwiki] could be found
The copy / rename itself uses the right location.
Cause
updateLocation in uicomponents/widgets/locationPicker.js resolves the parent field as a space reference, then always calls spaceReference.appendParent(new XWiki.WikiReference(wiki)). When the parent field already contains the wiki, the resolved reference already has a wiki parent, and appendParent adds a second one above it: the reference sent to the hierarchy_reference template is serialized as xwiki:xwiki:Space.Target.WebHome, whose wiki is parsed as xwiki:xwiki. The same file already resolves the parent field with the wiki as a default value instead (XWiki.Model.resolve(parentField.val(), XWiki.EntityType.SPACE, [wiki])), which is what the copy / rename templates do too.
Seen on CI with the functional tests CopyPageIT and RenamePageIT, which fill the parent field with a serialized space reference including the wiki.
Attachments
Issue Links
- relates to
-
XWIKI-12217 Adapt the "copy" action for nested documents
-
- Closed
-
-
XWIKI-12431 Adapt the "rename" action for nested documents
-
- Closed
-