プロジェクト

全般

プロフィール

Vote #77736

完了

Filter on issue ID with between/lesser/greater operator does not work

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

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

0%

予定工数:
category_id:
56
version_id:
122
issue_org_id:
23596
author_id:
154757
assigned_to_id:
1
comments:
5
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
110
ステータス-->[Closed]

説明

Version 3.3.0 introduced the feature to filter by issues by id, including range, see #4806.

This feature does not work correctly. When a range should be displayed, only a single issue is returned.

Several issues exist in test database:

!list_of_issues.PNG!

Query result should show IDs 5 to 10:

!list_greater_id_five.PNG!

Query result should show IDs 6 to 8:

!list_range_id_six_to_eight.PNG!


journals

This should work.

app/models/issue_query.rb
<pre><code class="ruby">
def sql_for_issue_id_field(field, operator, value)
ids = value.first.to_s.scan(/\d+/).map(&:to_i).join(",")

if ids.present?
if operator == "="
"#{Issue.table_name}.id IN (#{ids})"
else
sql_for_field("id", operator, value, Issue.table_name, "id")
end
else
"1=0"
end
end
</code></pre>
--------------------------------------------------------------------------------
I confirmed the problem and dee cay's fix (#23596#note-1) works fine.
This is a patch made from dee cay's post: attachment:defect-23596.diff

Setting target version to 3.3.1.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Slightly different fix applied in r15751, thanks for pointing this out.
--------------------------------------------------------------------------------

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


related_issues

relates,Closed,4806,Filter the issue list by issue ids

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

  • カテゴリIssues filter_56 にセット
  • 対象バージョン3.3.1_122 にセット

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

いいね!0
いいね!0