From 7daa5b750fe657f662247868e8a8db89ee5b29a6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 1 Oct 2016 08:13:40 +0000 Subject: Previous/Next navigation on a issue is not displayed on r15639 and later (#23781). git-svn-id: http://svn.redmine.org/redmine/trunk@15850 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/queries_helper.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 6bf8b3177..57a45312e 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -262,16 +262,19 @@ module QueriesHelper end end - def retrieve_query_from_session - if session[:query] - if session[:query][:id] - @query = IssueQuery.find_by_id(session[:query][:id]) + def retrieve_query_from_session(klass=IssueQuery) + session_key = klass.name.underscore.to_sym + session_data = session[session_key] + + if session_data + if session_data[:id] + @query = IssueQuery.find_by_id(session_data[:id]) return unless @query else - @query = IssueQuery.new(:name => "_", :filters => session[:query][:filters], :group_by => session[:query][:group_by], :column_names => session[:query][:column_names], :totalable_names => session[:query][:totalable_names]) + @query = IssueQuery.new(:name => "_", :filters => session_data[:filters], :group_by => session_data[:group_by], :column_names => session_data[:column_names], :totalable_names => session_data[:totalable_names]) end - if session[:query].has_key?(:project_id) - @query.project_id = session[:query][:project_id] + if session_data.has_key?(:project_id) + @query.project_id = session_data[:project_id] else @query.project = @project end -- cgit v1.2.3