]> source.dussan.org Git - redmine.git/commitdiff
Fixed: Sorting a query on a value that isn't in the displayed columns fails (#3078).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 4 Apr 2009 10:00:22 +0000 (10:00 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 4 Apr 2009 10:00:22 +0000 (10:00 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2647 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb

index a41dc504068ac23652da8a64d4f0635fb5850433..4ab5bba1ab1b1d46deb156e1a6d97ed2a6f82dd3 100644 (file)
@@ -46,7 +46,7 @@ class IssuesController < ApplicationController
   def index
     retrieve_query
     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?
       limit = per_page_option