]> source.dussan.org Git - redmine.git/commitdiff
Fix: Sort issue custom fields by position in tracker views (#28393).
authorGo MAEDA <maeda@farend.jp>
Sun, 25 Mar 2018 09:49:52 +0000 (09:49 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 25 Mar 2018 09:49:52 +0000 (09:49 +0000)
Patch by Gregor Schmidt.

git-svn-id: http://svn.redmine.org/redmine/trunk@17237 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/trackers_controller.rb
app/views/trackers/_form.html.erb

index b0e6979c95afd98d1f6c4053b276fc3f43ee4847..caf6b116516d7259257a27666bc3f0f4230ca7e5 100644 (file)
@@ -106,6 +106,6 @@ class TrackersController < ApplicationController
       return
     end
     @trackers = Tracker.sorted.to_a
-    @custom_fields = IssueCustomField.all.sort
+    @custom_fields = IssueCustomField.sorted
   end
 end
index 7b5b7ea61a8d7641ed7412975067a08155706d15..3d71d769476886a9e03d357707f7bbd6c4520d63 100644 (file)
 </p>
 <%= hidden_field_tag 'tracker[core_fields][]', '' %>
 
-<% if IssueCustomField.all.any? %>
+<% @issue_custom_fields = IssueCustomField.sorted %>
+<% if @issue_custom_fields.present? %>
 <p>
   <label><%= l(:label_custom_field_plural) %></label>
-  <% IssueCustomField.all.each do |field| %>
+  <% @issue_custom_fields.each do |field| %>
     <label class="block">
       <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field), :id => nil %>
       <%= field.name %>