Defect #5006

Roadmap display can raise an exception if no trackers are selected

Added by Jan from Planio www.plan.io over 7 years ago. Updated over 7 years ago.

Status:ClosedStart date:2010-03-08
Priority:HighDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Roadmap
Target version:0.9.4
Resolution:Fixed Affected version:

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.

projects_controller.patch Magnifier (605 Bytes) Jan from Planio www.plan.io, 2010-03-08 12:28

Associated revisions

Revision 3555
Added by Jean-Philippe Lang over 7 years ago

Fixed: NoMethodError error on roadmap if no trackers are selected and a shared version is available (#5006).

History

#1 Updated by Jean-Philippe Lang over 7 years ago

  • Status changed from New to Closed
  • Target version set to 0.9.4
  • Resolution set to Fixed

Fixed in r3555. Thanks.

Also available in: Atom PDF