From 7c0caa10b2432a12ab1db41f9a5b73dd3fd56927 Mon Sep 17 00:00:00 2001 From: Shintaro Kojima Date: Fri, 29 Dec 2017 02:13:28 +0900 Subject: [PATCH] Use QueryFilter instead of Hash to support redmine 3.4 --- lib/already_read/issue_query_patch.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/already_read/issue_query_patch.rb b/lib/already_read/issue_query_patch.rb index 9a88e22..c9db904 100644 --- a/lib/already_read/issue_query_patch.rb +++ b/lib/already_read/issue_query_patch.rb @@ -20,7 +20,17 @@ def available_filters_with_already_read available_filters_without_already_read if !has_filter?('already_read') - @available_filters['already_read'] = {:type => :list, :order => 20, :values => @available_filters['author_id'][:values], :name => l(:field_already_read)} + if Redmine::VERSION.to_a[0] >= 3 && Redmine::VERSION.to_a[1] >= 4 # newer or equal to 3.4.0 + @available_filters['already_read'] = QueryFilter.new( + 'already_read', + type: :list, + order: 20, + values: @available_filters['author_id'][:values], + name: l(:field_already_read) + ) + else + @available_filters['already_read'] = {:type => :list, :order => 20, :values => @available_filters['author_id'][:values], :name => l(:field_already_read)} + end end return @available_filters