From dd7189b1d028f6caa04da22b431a87b2b404d7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Maldonado?= Date: Tue, 4 Mar 2025 17:28:27 +0100 Subject: [PATCH] Fix: sort $aux_account after adding all items Currently, some items are added to $aux_account, then the array is sorted, then more items are added. In the end, the list visible in the UI is not sorted. --- htdocs/core/class/html.formaccounting.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index b1917f42ee8..e144ae5c569 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -502,8 +502,6 @@ class FormAccounting extends Form return -1; } - ksort($aux_account); - $this->db->free($resql); // Auxiliary user account @@ -526,6 +524,8 @@ class FormAccounting extends Form } $this->db->free($resql); + ksort($aux_account); + if ($usecache) { $this->options_cache[$usecache] = $aux_account; }