From a69ebf59d56875ad6fe62dd65fbf46bed918ff30 Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Wed, 30 Jul 2014 08:22:27 +0200 Subject: [PATCH] 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. --- lib/open_project/backlogs/hooks.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/open_project/backlogs/hooks.rb b/lib/open_project/backlogs/hooks.rb index 338f129482..7327544d42 100644 --- a/lib/open_project/backlogs/hooks.rb +++ b/lib/open_project/backlogs/hooks.rb @@ -53,10 +53,10 @@ module OpenProject::Backlogs::Hooks end def work_packages_overview_attributes(context = {}) - work_package = context[:work_package] + project = context[:project] attributes = context[:attributes] - return unless work_package.backlogs_enabled? + return unless project && project.module_enabled?(:backlogs) attributes << :storyPoints attributes << :remainingHours