diff --git a/Classes/Domain/Model/Event.php b/Classes/Domain/Model/Event.php index b74e9ad..4b9a2bd 100644 --- a/Classes/Domain/Model/Event.php +++ b/Classes/Domain/Model/Event.php @@ -795,4 +795,12 @@ class Event extends AbstractEntity { return $this->_languageUid; } + + /** + * @return int + */ + public function getLocalizedUid() + { + return $this->_localizedUid; + } } diff --git a/Classes/Domain/Repository/EventRepository.php b/Classes/Domain/Repository/EventRepository.php index 403c6db..2797deb 100644 --- a/Classes/Domain/Repository/EventRepository.php +++ b/Classes/Domain/Repository/EventRepository.php @@ -95,7 +95,14 @@ class EventRepository extends Repository usort($result, function (Event $eventA, Event $eventB) use ($expectedSorting) { $positionOfA = array_search($eventA->getUid(), $expectedSorting); + if ($positionOfA === false) { + $positionOfA = array_search($eventA->getLocalizedUid(), $expectedSorting); + } + $positionOfB = array_search($eventB->getUid(), $expectedSorting); + if ($positionOfB === false) { + $positionOfB = array_search($eventB->getLocalizedUid(), $expectedSorting); + } return $positionOfA <=> $positionOfB; });