プロジェクト

全般

プロフィール

Vote #76607

完了

Subject filter doesn't work with non ASCII uppercase symbols

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
102
issue_org_id:
20438
author_id:
126864
assigned_to_id:
1
comments:
10
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
97
ステータス-->[Closed]

説明

If you search by containing cyrillic uppercase symbols, you get empty result. The query for search looks like

@when "~"
sql = "LOWER(#{db_table}.#{db_field}) LIKE '%#{self.class.connection.quote_string(value.first.to_s.downcase)}%'"@

but ruby function downcase wokrs only with latin symbols.

We add special private method:

@def like_operator(content)
if Redmine::Database.postgresql?
"ILIKE '%#{content}%' "
else
"LIKE LOWER(#{content})"
end
end@

and override method sql_for_field

@when "~"
sql = "LOWER(#{db_table}.#{db_field}) #{like_operator(self.class.connection.quote_string(value.first.to_s.downcase))}"
when "!~"
sql = "LOWER(#{db_table}.#{db_field}) NOT #{like_operator(self.class.connection.quote_string(value.first.to_s.downcase))}"@


journals

What db do you use?
If it is SQLite3, it does not work (r13760).
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I'm using postgresql. I have a small experience with SQLite. How can I improve it?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Please post by patch. I am confused with "query" and "search".
Please add tests like r2796 and r13767.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Fixed in r14476.
--------------------------------------------------------------------------------


related_issues

relates,Closed,3536,Case sensitivity in Issue filtering

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョン3.2.0_102 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0