Defect #5006
Roadmap display can raise an exception if no trackers are selected
| Status: | Closed | Start date: | 2010-03-08 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | Jean-Philippe Lang | % Done: | 0% |
|
| Category: | Roadmap | |||
| Target version: | 0.9.4 | |||
| Affected version: | devel | Resolution: | Fixed |
Description
In projects_controller.rb, line 297:
@issues_by_version = {}
unless @selected_tracker_ids.empty?
@versions.each do |version|
issues = version.fixed_issues.visible.find(:all,
:include => [:project, :status, :tracker, :priority],
:conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids},
:order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id")
@issues_by_version[version] = issues
end
end
@versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].empty?}
if @selected_tracker_ids.empty? is true, @issues_by_version will always be {} and @issues_by_version[version].empty? yields a NoMethodError.
Instead of empty?, blank? should be used. Patch is attached.
Associated revisions
Fixed: NoMethodError error on roadmap if no trackers are selected and a shared version is available (#5006).
History
Updated by Jean-Philippe Lang almost 2 years ago
- Status changed from New to Closed
- Target version set to 0.9.4
- Resolution set to Fixed
Fixed in r3555. Thanks.