Details
-
Bug
-
Resolution: Fixed
-
Major
-
3.3-rc-1
-
None
-
save create document author creator subwiki
-
Unknown
-
Description
Doing something like this from the main wiki while logged in as xwiki:XWiki.Admin (global admin):
#set ($documentOnAnotherWiki = $xwiki.getDocument('someWiki:Space.Page')) $documentOnAnotherWiki.setContent('newContent') $documentOnAnotherWiki.save('modified')
Will result in a modification done by someWiki:XWiki.Admin (local admin) in the 'someWiki' subwiki.
This is because the Document.saveDocument() method gets the author from XWikiContext.getUser() which, in turn, uses the XWikiContext.getDatabase() wiki for the compactWikiEntityReferenceSerializer to resolve the user string instead of using the saved document's wiki.
The solution is to use the user references and the previous translation problems are automatically resolved.