Important: #110540 - File collector sorting uses an enum
See forge#110540
Description
The sorting order passed to
\TYPO3\ is no longer a plain
string but the new enum
\TYPO3\ with the cases
Ascending
,
Descending
and
Random
.
File is marked as
@internal
, so this is not treated as a
breaking change. Extensions calling
sort directly must nevertheless
adapt their code:
// before
$fileCollector->sort('title', 'descending');
// after
$fileCollector->sort('title', FileCollectionSorting::Descending);
// when the value comes from configuration or user input
$fileCollector->sort(
'title',
FileCollectionSorting::fromKeyword($direction),
);
File resolves both the short and the
long keywords (
asc
,
ascending
,
desc
,
descending
,
rand
,
random
) case-insensitively, and throws a
\Value for anything else.
The TypoScript option
sorting. of the
FILES
content object and of the
files
data processor keeps accepting the
same keywords as before. An unknown keyword is no longer silently treated as
"ascending" though, but now results in a
\Value.