Project

General

Profile

Actions

Defect #40100

open

User ordering by name is incorrect for french language

Added by philippe lhardy 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Accounts / authentication
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

Capture d’écran du 2024-01-23 15-42-09.png (48.2 KB) Capture d’écran du 2024-01-23 15-42-09.png assignee drop-down list in issue with french names philippe lhardy, 2024-01-23 15:43
Capture d’écran du 2024-01-23 15-46-45.png (53.7 KB) Capture d’écran du 2024-01-23 15-46-45.png Listing of users in project members philippe lhardy, 2024-01-23 15:47
Capture d’écran du 2024-01-23 15-53-29.png (136 KB) Capture d’écran du 2024-01-23 15-53-29.png watcher ordering in grey and watcher search philippe lhardy, 2024-01-23 15:54
user_sorting_20240123193437.patch (2.07 KB) user_sorting_20240123193437.patch proposal for assignee drop_down_list and watcher fix philippe lhardy, 2024-01-23 19:37
Actions #1

Updated by philippe lhardy 3 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

Actions #2

Updated by philippe lhardy 3 months ago

Example of listing in drop down list of assignee.

Actions #3

Updated by philippe lhardy 3 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.

Actions #4

Updated by philippe lhardy 3 months ago

watcher ordering is different from the list given in search for those.

Actions #5

Updated by philippe lhardy 3 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
Actions #6

Updated by philippe lhardy 3 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.

Actions #7

Updated by Go MAEDA 3 months ago

  • Target version set to Candidate for next major release
Actions #8

Updated by Bolesław Kalinowski 3 months ago

Patch user_sorting_20240123193437.patch doesn't correct error for Polish language.

Actions #9

Updated by philippe lhardy 3 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.

Actions #10

Updated by Bolesław Kalinowski 3 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?

Actions

Also available in: Atom PDF