This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-b3bc2497-1f1c-46d1-9484-8fcdaeb4206f XWIKI-22527 Open

Current document is not properly set when calling LiveTable Results in LiveData

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-78a6384c-ba65-49c1-8b05-582015e6f099 Simon Urli created this issue on 24/Sep/24 09:31
 
Summary: Current document is not properly set when calling LiveTable Results in LiveData
Issue Type: cid:jira-generated-image-avatar-b3bc2497-1f1c-46d1-9484-8fcdaeb4206f Bug
Affects Versions: 16.4.2
Assignee: Unassigned
Components: Live Data
Created: 24/Sep/24 09:31
Priority: cid:jira-generated-image-static-major-b9a70ac1-9fd5-4a21-aaa9-bd01a92958b6 Major
Reporter: Simon Urli
Description:

Reproduction steps:

  • Create a dedicated LiveTable results containing some code such as:
    noformat
    velocity wiki="false"
    #set ($lastAuthor = $doc.contentAuthorReference)
    #set ($currentUser = $xcontext.userReference)
    #set ($discard = $xcontext.context.setUserReference($lastAuthor))
    #gridresultwithfilter("XWiki.XWikiUsers" $request.collist.split(","))
    #set ($discard = $xcontext.context.setUserReference($currentUser))
    /velocity
    noformat
  • Create a livedata using that result page

Expected result:

  • the livedata displays the entries by using the defined context user

Obtained result:

  • the livedata doesn't display any entry, only N/A rows. However it works by resoluving manually the author.

The reason of the error is apparently that $doc is not properly assigned when the request is made in LiveData REST API to get LT results.