Actions
Defect #23596
closedFilter on issue ID with between/lesser/greater operator does not work
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
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:
Query result should show IDs 5 to 10:
Query result should show IDs 6 to 8:
Files
Related issues
Updated by dee cay over 8 years ago
This should work.
app/models/issue_query.rb
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
Updated by Go MAEDA over 8 years ago
- File defect-23596.diff defect-23596.diff added
- Status changed from New to Confirmed
- Priority changed from High to Normal
- Target version set to 3.3.1
I confirmed the problem and dee cay's fix (#23596#note-1) works fine.
This is a patch made from dee cay's post: defect-23596.diff
Setting target version to 3.3.1.
Updated by Toshi MARUYAMA over 8 years ago
- Related to Feature #4806: Filter the issue list by issue ids added
Updated by Jean-Philippe Lang over 8 years ago
- Subject changed from Filter on issue ID does not work correctly to Filter on issue ID with between/lesser/greater operator does not work
- Status changed from Confirmed to Resolved
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Slightly different fix applied in r15751, thanks for pointing this out.
Updated by Jean-Philippe Lang over 8 years ago
- Status changed from Resolved to Closed
Actions