---
title: "Important: A paginated selection keeps its order"
manual: "Academic Profiles"
version: "main"
source: "Changelog/3.0/Important-PaginatedSelectionKeepsItsOrder.rst"
rendered: "2026-09-22T18:32:44+00:00"
---

# Important: A paginated selection keeps its order {#important-paginated-selection-keeps-its-order}

## Description {#description}

The profile list and list-and-detail plugins let an editor pick the profiles by
hand (**List of profiles**) and switch **Pagination** on at the
same time. Such a selection is an ordered list, but the query that fetches it
matches `uid IN (...)`, which does not preserve that order -
`ProfileController::listAction()` restored it afterwards, in PHP.

With pagination switched on, the pages were cut out of the *query* result
instead, in database order, while the restored order only reached a view
variable the template does not render in that case. So the visible order was
the database's. The paginated statement also carried no `ORDER BY` at all,
which let two pages show the same profile, or none show it, on PostgreSQL.

The selection is now sorted before it is paginated, and the pages are cut out of
the sorted list. The selection branch of
`ProfileRepository::resolveDemandForQuery()` orders by `uid` ascending
as well now, like every other branch: that result is what listeners of
`ModifyListProfilesEvent` receive, and it has to be the same list twice.

## Impact {#impact}

A list plugin with a manual selection **and** pagination renders its pages in
the order the editor arranged them, from the first page on, and every selected
profile appears on exactly one page on every supported database.

Nothing changes for a list without a manual selection, for a selection without
pagination, or for the card, selected-profiles and selected-contracts plugins,
which sort a selection and do not paginate.

## Affected Installations {#affected-installations}

Every installation with a profile list or list-and-detail plugin that combines a
manual selection with pagination. An installation that worked around the defect
by arranging its selection in database order sees its pages change.
