From 1e6a6941d2b02978f242e2e898becd8d149457d9 Mon Sep 17 00:00:00 2001 From: Till Breuer Date: Thu, 5 Dec 2013 16:07:16 +0100 Subject: [PATCH] Fix work packages sidebar hook after query filter refactoring (#2395) --- doc/CHANGELOG.md | 1 + lib/open_project/backlogs/hooks.rb | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 98d335adf0..de44205d8f 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -36,6 +36,7 @@ See doc/COPYRIGHT.rdoc for more details. # Changelog +* `#2395` [Work Package Tracking] Internal Error when entering a character in a number field in a filter * Adaptations for new icon font * Fix: Backlog data existence check diff --git a/lib/open_project/backlogs/hooks.rb b/lib/open_project/backlogs/hooks.rb index 7e08e2a1da..f8e87ea313 100644 --- a/lib/open_project/backlogs/hooks.rb +++ b/lib/open_project/backlogs/hooks.rb @@ -55,9 +55,9 @@ module OpenProject::Backlogs::Hooks q = context[:request].session[:query] if q && q[:filters] - sprint = q[:filters]['fixed_version_id'] - if sprint && sprint[:operator] == '=' && sprint[:values].size == 1 - locals[:sprint] = Sprint.find_by_id(sprint[:values][0]) + sprint = q[:filters].detect{|f| f.field == :fixed_version_id} + if sprint && sprint.operator == '=' && sprint.values.size == 1 + locals[:sprint] = Sprint.find_by_id(sprint.values[0]) end end