diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb index 99fffadeb..7c79189ac 100644 --- a/app/views/custom_fields/_form.html.erb +++ b/app/views/custom_fields/_form.html.erb @@ -102,8 +102,9 @@ when "IssueCustomField" %>
<%= l(:label_project_plural) %> + <% project_ids = @custom_field.project_ids.to_a %> <%= render_project_nested_lists(Project.all) do |p| - content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + p) + content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p) end %> <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>

<%= check_all_links 'custom_field_project_ids' %>