---
title: "Important: Page media follows the reference sorting"
manual: "Academic Programs"
version: "main"
permalink: "https://docs.typo3.org/permalink/fgtclb/academic-programs:important-page-media-follows-the-reference-sorting@main"
source: "Changelog/2.4/Important-PageMediaFollowsTheReferenceSorting.rst"
rendered: "2026-10-17T08:47:58+00:00"
---

# Important: Page media follows the reference sorting {#important-page-media-follows-the-reference-sorting}

## Description {#description}

`\FGTCLB\AcademicPrograms\Collection\FileReferenceCollection::getCollectionByPageIdAndField()`
read `sys_file_reference` without an ordering, so a page with several
files in one field returned them in whatever order the database yielded. The
`sorting_foreign` an editor arranges in the field was ignored, and on
PostgreSQL the order could differ between two calls for the same page. The
query now orders by `sorting_foreign`, with `uid` settling ties.

## Impact {#impact}

Nothing this extension renders uses the collection. Code of a project that
calls the method gets the files in the order the editor arranged them on the
page. That is what SQLite, MySQL and MariaDB delivered in practice for
references that were never reordered, and what editors expressed but never got
for references that were.

## Affected Installations {#affected-installations}

Installations whose own code calls
`FileReferenceCollection::getCollectionByPageIdAndField()`. Nothing has to
be done on update.
