Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-22527

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • 16.4.2
    • Live Data
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              acotiuga Alex Cotiugă
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: