Project

General

Profile

Actions

Defect #32382

closed

Unreliable User mention feature with PostgreSQL

Added by Kenta Kogumasaka over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

Our Redmine system has been migrated to the new instance with PostgreSQL / Ubuntu 18, but we now observe that the User mention feature is unreliable.
The symptom is that accounts consisted of lowercase characters only can be found and mentioned, but ones with uppercase characters only / the combination of uppercase and lowercase cannot be mentioned. Both cases were fine with MySQL before migration.

Environment:
  Redmine version                3.4.11.stable
  Ruby version                   2.4.6-p354 (2019-04-01) [x86_64-linux]
  Rails version                  4.2.11.1
  Environment                    production
  Database adapter               PostgreSQL

Thank you for your help!


Related issues

Is duplicate of Redmine - Defect #26892: Link to user in wiki syntax only works when login is written in lower caseClosedJean-Philippe Lang

Actions
Actions #1

Updated by Go MAEDA over 4 years ago

The current version of Redmine does not have a mentioning feature. Are you talking about a plugin that provides the feature?

Actions #2

Updated by Kenta Kogumasaka over 4 years ago

Hello Maeda San!

I don't think we've installed any plugin such as https://www.redmine.org/plugins/redmine-mentions. I found #4179#note-41 and #13919#note-37 that you have already been in a loop, and both patches look already implemented for master.
(See https://github.com/redmine/redmine/blob/master/app/helpers/application_helper.rb#L1134)

That's why I thought the feature has been already in production. What do you think?

Actions #3

Updated by Go MAEDA over 4 years ago

Kenta Kogumasaka wrote:

I don't think we've installed any plugin such as https://www.redmine.org/plugins/redmine-mentions. I found #4179#note-41 and #13919#note-37 that you have already been in a loop, and both patches look already implemented for master.
(See https://github.com/redmine/redmine/blob/master/app/helpers/application_helper.rb#L1134)

Thank you for the detailed information. I understood. My understanding is that "mention" means the link to user feature (#4179) and you cannot make a link to a user if you use uppercase characters. Is it correct?

Actions #4

Updated by Kenta Kogumasaka over 4 years ago

Yes, it's more or less correct. Strictly speaking, we cannot make a link to a user account that has uppercase character(s). Here is some examples:

Full name Redmine Account
(case-sensitive)
Try Result
Yamada, Taro tyamada
(all are lowercases)
辰也 山田 Linked
辰也 山田 NG
辰也 山田
Yamada, Hanako HYamada
(H and Y are uppercases)
@HYamada NG
@hyamada
@HYAMADA
John Smith JSMITH
(all are uppercases)
@jsmith NG
@JSMITH
@JSMith

The accounts that consist of lowercases only can be linked if using @<username> with lowercases.
Thousands of accounts in our Redmine have been imported with LDAP Sync, and I don't feel it would be practical to replace all uppercases to lowercases in the "users" table.

Actions #5

Updated by Holger Just over 4 years ago

Instead of User.visible.where(:login => name, :type => 'User').first, we should probably use User.visible.find_by_login(name) to find the user in ApplictionHelper#parse_redmine_links. Here, we already perform a fallback to a case-insensitive match if necessary.

Let me check if that does it...

Actions #6

Updated by Kenta Kogumasaka over 4 years ago

Danke schön, Holger!

Actions #7

Updated by Mischa The Evil over 4 years ago

  • Related to Defect #26892: Link to user in wiki syntax only works when login is written in lower case added
Actions #8

Updated by Marius BĂLTEANU over 4 years ago

  • Status changed from New to Needs feedback

test test Kogumasaka, this problem was fixed in Redmine 4.0, please see #26892 for more details.

Not being a very big change, maybe you can apply the fix on your instance.

Actions #9

Updated by Marius BĂLTEANU about 4 years ago

  • Related to deleted (Defect #26892: Link to user in wiki syntax only works when login is written in lower case)
Actions #10

Updated by Marius BĂLTEANU about 4 years ago

  • Is duplicate of Defect #26892: Link to user in wiki syntax only works when login is written in lower case added
Actions #11

Updated by Marius BĂLTEANU about 4 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Duplicate
Actions

Also available in: Atom PDF