Defect #40100
open
User ordering by name is incorrect for french language
Added by philippe lhardy 10 months ago.
Updated 10 months ago.
Category:
Accounts / authentication
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
Example of listing in drop down list of assignee.
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.
watcher ordering is different from the list given in search for those.
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
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.
- Target version set to Candidate for next major release
Patch user_sorting_20240123193437.patch doesn't correct error for Polish language.
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.
Also available in: Atom
PDF