This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-ed13308f-5262-467f-8748-9ab54e701a03 XWIKI-22526 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-53f1e0fe-4397-42c7-9c61-3cc8ede6724f 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-ed13308f-5262-467f-8748-9ab54e701a03 Bug
Affects Versions: 16.4.2
Assignee: Unassigned
Components: Live Data
Created: 24/Sep/24 09:31
Priority: cid:jira-generated-image-static-major-8cdd3d68-76e7-41be-81ef-97b026e046b9 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.