Skip to content

Commit

Permalink
Merge branch 'bugfix/multilingual-addRelatedRecord' into develop-v11
Browse files Browse the repository at this point in the history
[BUGIFX] Sort query results by language
  • Loading branch information
dhoffmann1979 committed Oct 10, 2023
2 parents 050aebb + 59469c1 commit 108de4b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public function findByProperty(string $table, string $property, array $values):
$query->orderBy('uid');
}

if (!empty($GLOBALS['TCA'][$table]['ctrl']['languageField'])) {
$query->addOrderBy($GLOBALS['TCA'][$table]['ctrl']['languageField']);
}

$result = $query->execute();
return array_column($result->fetchAllAssociative(), null, 'uid');
}
Expand Down

0 comments on commit 108de4b

Please sign in to comment.