Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
15.10.8, 16.2.0
-
Integration
-
Unknown
-
N/A
-
N/A
-
Description
Reproduction steps:
- Create a page "Test" containing multiple revisions (I created 5 in my case)
- Create a page "Script" containing the following snippet (ensure that the page created at step 1 has a reference "xwiki:Test.WebHome" or edit the script)
{{velocity}} #set ($myTest = "xwiki:Test.WebHome") #set ($startAt = 0) #set ($endAt = -1) #set ($criteria = $xwiki.criteriaService.revisionCriteriaFactory.createRevisionCriteria('', $minorVersions)) #set ($range = $xwiki.criteriaService.rangeFactory.createRange($startAt, $endAt)) #set ($discard = $criteria.setRange($range)) #set ($myDoc = $xwiki.getDocument($myTest)) #set ($xwikiDoc = $myDoc.document) XWiki Doc: $xwikiDoc #set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context)) Revision: $revisions #set ($discard = $xwikiDoc.setDocumentReference("xwiki:Foo.WebHome")) XWiki Doc: $xwikiDoc #set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context)) Revision: $revisions {{/velocity}}
- Save and view the page with the snippet
Expected result:
- The page should display:
XWiki Doc: Test.WebHome Revision: [5.1] XWiki Doc: Foo.WebHome Revision: [5.1]
Obtained result:
- The page display:
XWiki Doc: Test.WebHome Revision: [5.1] XWiki Doc: Foo.WebHome Revision: []
Attachments
Issue Links
- is caused by
-
XWIKI-21922 Introduce methods to fetch a subset of revisions in XWikiVersioningStoreInterface
-
- Closed
-