Check project for backlogs module

The hook is called from the OP core's work package controller index
method. For index no specific WP is selected. Thus, we must use the
selected project to check if the backlogs module is activated.
pull/6827/head
Hagen Schink 10 years ago
parent 5e5fc0d4b5
commit a69ebf59d5
  1. 4
      lib/open_project/backlogs/hooks.rb

@ -53,10 +53,10 @@ module OpenProject::Backlogs::Hooks
end end
def work_packages_overview_attributes(context = {}) def work_packages_overview_attributes(context = {})
work_package = context[:work_package] project = context[:project]
attributes = context[:attributes] attributes = context[:attributes]
return unless work_package.backlogs_enabled? return unless project && project.module_enabled?(:backlogs)
attributes << :storyPoints attributes << :storyPoints
attributes << :remainingHours attributes << :remainingHours

Loading…
Cancel
Save