Project

General

Profile

Defect #34778 » 0025-Subject-is-safe-for-new-issue.patch

Frederico Camara, 2021-02-20 19:59

View differences:

app/models/issue.rb
560 560
    names -= disabled_core_fields
561 561
    names -= read_only_attribute_names(user)
562 562
    if new_record?
563
      # Make sure that project_id can always be set for new issues
563
      # Make sure that project_id and subject can always be set for new issues
564 564
      names |= %w(project_id)
565
      names |= %w(subject)
565 566
    end
566 567
    if dates_derived?
567 568
      names -= %w(start_date due_date)
app/views/issues/_form.html.erb
15 15
                :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)" %></p>
16 16
<% end %>
17 17

  
18
<% if @issue.safe_attribute?('tracker_id') || (@issue.persisted? && @issue.tracker_id_changed?) %>
18
<% if @issue.safe_attribute?('tracker_id') || (@issue.persisted? && @issue.tracker_id_changed?) || @issue.new_record? %>
19 19
<p>
20 20
  <%= f.select :tracker_id, trackers_options_for_select(@issue), {:required => true},
21 21
               :onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)",
......
24 24
</p>
25 25
  <%= render partial: 'issues/trackers_description', locals: {trackers: trackers_for_select(@issue)} %>
26 26
<% end %>
27

  
28
<% if @issue.safe_attribute? 'subject' %>
27
<% if @issue.safe_attribute?('subject') || @issue.new_record? %>
29 28
<p><%= f.text_field :subject, :size => 80, :maxlength => 255, :required => true %></p>
30 29
<% end %>
31 30

  
(1-1/2)