This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-04e6199b-bd60-41b4-ad05-a41b1a56b72d XWIKI-22525 Open

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

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-41aecce1-3345-4e3e-8ea7-3ec824be0f15 Simon Urli created this issue on 24/Sep/24 09:28
 
Summary: Current document is not properly set when calling LiveTable Results in LiveData
Issue Type: cid:jira-generated-image-avatar-04e6199b-bd60-41b4-ad05-a41b1a56b72d Bug
Affects Versions: 16.4.2
Assignee: Unassigned
Components: Live Data
Created: 24/Sep/24 09:28
Priority: cid:jira-generated-image-static-major-a48a4dd1-5caa-421a-8c33-25512718ee80 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.