Defect #40100
openUser ordering by name is incorrect for french language
0%
Description
by example in user list to pick for ticket assignement users with accentuated characters don't follow natural french ordering.
It should normalize name with accentuated characters like éè to correponding non accenutated letter prior of ordering.
when the list is very long it can lead to the false impression that user is not registered.
in redmine : Claire < Clovis < Clément < Constantin < Cyril < Céline
while we would expect : Céline (Celine) < Claire < Clément (Clement) < Clovis < Constantin < Cyril
Files
Updated by philippe lhardy 10 months ago
I noticed that some features have been requested for user ordering like :
https://www.redmine.org/issues/19484
https://www.redmine.org/issues/22497
Updated by philippe lhardy 10 months ago
Example of listing in drop down list of assignee.
Updated by philippe lhardy 10 months ago
This problem does not show in listing of project members, so this bug depends on context and redmine already knows how to deal correctly with accentuated ordering.
Updated by philippe lhardy 10 months ago
watcher ordering is different from the list given in search for those.
Updated by philippe lhardy 10 months ago
It is possible to fix watcher ordering by replacing sort by in sorted app/helpers/issues_helper.rb
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 2453c1204..ca5c163e4 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -467,7 +467,7 @@ module IssuesHelper
users = issue.watcher_users.select{|u| u.status == User::STATUS_ACTIVE}
assignable_watchers = issue.project.principals.assignable_watchers.limit(21)
if assignable_watchers.size <= 20
- users += assignable_watchers.sort
+ users += assignable_watchers.sorted
end
users.uniq
end
Updated by philippe lhardy 10 months ago
Here my patch to fix assignee drop_down_list and watchers sorting in french.
might apply to any language where ascii/utf-8 ordering is not same than characters comparisons.
Updated by Bolesław Kalinowski 10 months ago
Patch user_sorting_20240123193437.patch doesn't correct error for Polish language.
Updated by philippe lhardy 10 months ago
Hi Boleslaw,
This patch assumption is that database ordering is fine while ruby ordering is not, patch is to always use sorted on active record and not sort on string. It might differ depending on database, i did my test on postgres.
Please open a specific defect for polish language with a set of example of expected ordering and link this new issue here.
Regards
Philippe.
Updated by Bolesław Kalinowski 10 months ago
Sorry, my mistake.
P.S.
Why, when I open https://www.redmine.org/attachments/31850, and compare with 'issues_helper.rb' (Redmine 5.1 stable) I see different line numbering?