diff --git a/typo3/sysext/backend/Classes/Form/Element/InlineElement.php b/typo3/sysext/backend/Classes/Form/Element/InlineElement.php index 4fd3b46..c11ca57 100644 --- a/typo3/sysext/backend/Classes/Form/Element/InlineElement.php +++ b/typo3/sysext/backend/Classes/Form/Element/InlineElement.php @@ -1540,6 +1540,16 @@ class InlineElement { } } } + + if (count($relatedRecords['records']) > 1 + && isset($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_sortby']) + ) { + $sortField = $GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_sortby']; + usort($relatedRecords['records'], function (array $a, array $b) use ($sortField) { + return $a[$sortField] > $b[$sortField]; + }); + } + return $relatedRecords; }