Defect #15227

Custom fields in issue form - splitting is incorrect

Added by eyal R about 4 years ago. Updated about 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Custom fields
Target version:2.4.0
Resolution:Fixed Affected version:

Description

I think there is a bug in the custom fields rendering:

app/views/issues/_form_custom_fields.html.erb

<div class="splitcontent">
<div class="splitcontentleft">
<% i = 0 %>
<% split_on = (@issue.custom_field_values.size / 2.0).ceil - 1 %>
<% @issue.editable_custom_field_values.each do |value| %>
  <p><%= custom_field_tag_with_label :issue, value, :required => @issue.required_attribute?(value.custom_field_id) %></p>
<% if i == split_on -%>
</div><div class="splitcontentright">
<% end -%>
<% i += 1 -%>
<% end -%>
</div>
</div>

I think the line

<% split_on = (@issue.custom_field_values.size / 2.0).ceil - 1 %>

should be

<% split_on = (@issue.editable_custom_field_values.size / 2.0).ceil - 1 %>

Since the calculation should be according to the custom fields that are going to be shown.

Thanks.

Associated revisions

Revision 12251
Added by Jean-Philippe Lang about 4 years ago

Custom fields in issue form - splitting is incorrect (#15227).

History

#1 Updated by Jean-Philippe Lang about 4 years ago

  • Category set to Custom fields
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.4.0
  • Resolution set to Fixed

Fixed in r12251, thanks for pointing this out.

Also available in: Atom PDF