Fixes rendering of 404 in work packages.

The rendering of 404 would result in a 500 being thrown when deciding on
the current menu item, which subsequently needs a project to ger a new
work package. There now is a fallback on issues.
pull/243/head
Martin Czuchra 11 years ago
parent c3b3d406fe
commit 9259367f87
  1. 16
      app/controllers/work_packages_controller.rb

@ -17,12 +17,16 @@ class WorkPackagesController < ApplicationController
include ExtendedHTTP
current_menu_item do |controller|
wp = controller.new_work_package || controller.work_package
case wp
when PlanningElement
:planning_elements
when Issue
begin
wp = controller.new_work_package || controller.work_package
case wp
when PlanningElement
:planning_elements
when Issue
:issues
end
rescue
:issues
end
end

Loading…
Cancel
Save