#93760uidInList does not respect the order of the comma-separated values
Description
Using uidInList (either TS select or DatabaseQueryProcessor) does not respect the order of the uids.
One has to use an ugly workaround, like this:
selectFields = *, FIND_IN_SET(uid, ###uidList###) AS uid_sort
(the marker being simply filled with the CSV field).
Of course this comes from the underlaying storage engine (MySQL in my case), but the core should implicitly order by the list automatically by adding a proper SQL statement ( FIND_IN_SET or ORDER BY FIELD()) or post-processing the result before passing it back to the user.
This is a bug, because TYPO3 allows to have sortable TCA select fields (multipleSideBySide, for example) that can be stored as CSV. So the core should respect the order when selecting on such a field.
Reviews 4
Related issues 1
History 1217
-
S P changed TYPO3 Version
910 <span data-processor="relativetime" data-value="2021-10-20T06:25:23+00:00" > 10/20/21, 06:25 </span> -
S P commented and changed TYPO3 Version
1012 <span data-processor="relativetime" data-value="2024-12-17T11:18:18+00:00" > 12/17/24, 11:18 </span>Still valid in v12.
-
S P commented and changed TYPO3 Version
1213 <span data-processor="relativetime" data-value="2024-12-19T08:41:25+00:00" > 12/19/24, 08:41 </span>Still valid on v13.
-
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2025-02-24T20:53:18+00:00" > 02/24/25, 20:53 </span>closed as duplicate of #86151 – still valid
-
Georg Ringer changed Duplicates #86151 <span data-processor="relativetime" data-value="2025-02-24T20:53:28+00:00" > 02/24/25, 20:53 </span>
-
S P commented <span data-processor="relativetime" data-value="2025-02-25T06:17:17+00:00" > 02/25/25, 06:17 </span>
Georg Ringer wrote in #note-5:
> closed as duplicate of #86151 – still validActually I think this is a total different issue. This here is about sorting not being respected in CSV-persistet relations. The other is about find_in_set not behaving as expected.
-
Georg Ringer changed status
ClosedAccepted <span data-processor="relativetime" data-value="2025-02-25T09:11:40+00:00" > 02/25/25, 09:11 </span> -
Georg Ringer changed
Duplicates #86151<span data-processor="relativetime" data-value="2025-02-25T09:12:00+00:00" > 02/25/25, 09:12 </span> -
Georg Ringer changed Related to #86151 <span data-processor="relativetime" data-value="2025-02-25T09:12:10+00:00" > 02/25/25, 09:12 </span>
-
S P commented and changed TYPO3 Version
1314 <span data-processor="relativetime" data-value="2026-06-11T07:34:05+00:00" > 06/11/26, 07:34 </span>Still valid on v14.
-
Gerrit Code Review pushed patch set 1 for main to change 95751 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2026-09-09T20:52:27+00:00" > 09/09/26, 20:52 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95751 <span data-processor="relativetime" data-value="2026-09-25T10:22:44+00:00" > 09/25/26, 10:22 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95751 <span data-processor="relativetime" data-value="2026-09-25T18:51:42+00:00" > 09/25/26, 18:51 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96094 <span data-processor="relativetime" data-value="2026-09-25T19:58:10+00:00" > 09/25/26, 19:58 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 96095 <span data-processor="relativetime" data-value="2026-09-25T20:12:33+00:00" > 09/25/26, 20:12 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-09-25T20:35:12+00:00" > 09/25/26, 20:35 </span>Applied in changeset commit:9f6bd7e9a60de9730ff42e39db9b5ce258ea6c39.
Have the same issue. Thanks for the report
This is my TS.
# keep order select.markers.orderings.data = field:field_of_parent_table select.selectFields = *, FIND_IN_SET(uid, ###orderings###) AS uid_sort select.orderBy = uid_sortI wonder how we could fix this to make this possible by default or with a flag and make it cross DBMS conform