Skip to content

Commit

Permalink
XWIKI-21786: The Live Data table in XWik.XWikiClasses (Data types pag…
Browse files Browse the repository at this point in the history
…e) shows an incorrect number of pages

(cherry picked from commit 13c0a2e)
  • Loading branch information
manuelleduc committed Jan 11, 2024
1 parent 837583a commit 26c1b66
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@
#foreach ($row in $output.rows)
#set ($statement = ', BaseObject as obj where doc.translation = 0 and ' +
'doc.fullName = obj.name and obj.className = :className')
#set ($row.pageCount = $services.query.hql($statement).bindValue('className', $row.doc_fullName).count())
## Note: the unique filter is required as otherwise pages are returned once for each contained XObjects, leading
## to larger counts than expected.
#set ($hqlQuery = $services.query.hql($statement).bindValue('className', $row.doc_fullName).addFilter('unique'))
#set ($row.pageCount = $hqlQuery.count())
#end
#jsonResponse($output)
#end
Expand Down

0 comments on commit 26c1b66

Please # to comment.