Project

General

Profile

Actions

Defect #25867

open

Assignable users should respect database collation

Added by Pavel Rosický almost 7 years ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

mysql collation: utf8_general_ci
['a','u','č'] should be sorted as ['a','č','u'] but because of ruby sort it's reordered back as ['a','u','č']

  def assignable_users
    users = project.assignable_users(tracker).to_a
    users << author if author && author.active?
    if assigned_to_id_was.present? && assignee = Principal.find_by_id(assigned_to_id_was)
      users << assignee
    end

    users.uniq.sort
  end

I can provide a patch, are you interested or is it desired behaviour?

Environment (not important, all redmine versions and databases are affected):
  Redmine version                3.3.3.devel.16557
  Ruby version                   2.1.5-p273 (2014-11-13) [x64-mingw32]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               Mysql2
SCM:
  Subversion                     1.9.5
  Git                            2.11.0
  Filesystem
Redmine plugins:
  no plugin installed

Files

issue_test.rb.patch (883 Bytes) issue_test.rb.patch Pavel Rosický, 2017-05-18 21:57
issue.rb.patch (1.16 KB) issue.rb.patch Pavel Rosický, 2017-05-18 21:57
25867.patch (2.01 KB) 25867.patch Go MAEDA, 2022-12-08 09:50
Actions

Also available in: Atom PDF