-
Notifications
You must be signed in to change notification settings - Fork 69
Sorting by last editing user in process and task list also filters the list #6904
Description
Describe the bug
When sorting either tasks or processes via the column "Last editing user", the list is not only sorted but also filtered. Any processes or tasks that were never assigned to any user are not shown any more.
To Reproduce
Steps to reproduce the behavior:
- Go to process or task list
- Show colum "Last editing user"
- Click on column "Last editing user" to sort the list
- See that the list now only shows tasks or processes that have a "last editing user"
Expected behavior
The list should also show tasks and processes that were never edited by any user.
Release
Current main
(probably Kitodo.Production 3.9.X, but haven't checked)
Additional context
I suspect that the problem lies in the construction of the HQL query that was introduced with the Hibernate Search update (#6503). When sorting by last edited user, the HQL sort criteria for "Last editing user" resolves to task.processingUser.surname or process.lastTask.processingUser.surname. Since the base query doesn't resolve these table joins, hibernate automatically assumes inner joins, which removes tasks or processes from the list that do not have a processingUser assigned.