Fixed: Sorting a query on a value that isn't in the displayed columns fails (#3078).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2647 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2009-04-04 10:00:22 +00:00
parent e40241761a
commit b7127e3c14
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class IssuesController < ApplicationController
def index def index
retrieve_query retrieve_query
sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria) sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)
sort_update({'id' => "#{Issue.table_name}.id"}.merge(@query.columns.inject({}) {|h, c| h[c.name.to_s] = c.sortable; h})) sort_update({'id' => "#{Issue.table_name}.id"}.merge(@query.available_columns.inject({}) {|h, c| h[c.name.to_s] = c.sortable; h}))
if @query.valid? if @query.valid?
limit = per_page_option limit = per_page_option