From 7da684a50785b3aeac189bafaa4c1e381e174214 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 17 Apr 2025 13:05:54 +0100 Subject: [PATCH] Bug 38646: (follow-up) Ensure consistent ordering of languages We add an `ORDER BY` clause to the SQL statement to ensure we consistently order accross databases by the iso code. This fixes the failing test on MariaDB as it's default sort order appears to differ from MySQL for this. This also ensure we are consistently ordering which will lead to more consistent and clear results for end users. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- C4/Languages.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index 7b1776874d..07b42e9781 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -260,7 +260,9 @@ sub getLanguages { AND native_language_descriptions.type = 'language' WHERE language_subtag_registry.type = 'language' - ${language_list_cond}" ); + ${language_list_cond} + + ORDER BY language_rfc4646_to_iso639.iso639_2_code ASC" ); if ($language_list) { $sth->execute( $current_language, join ',' => split( /,|\|/, $language_list ) );