Defect #31063

Can't uncheck Gantt chart options of custom queries

Added by Mizuki ISHIKAWA 3 months ago. Updated 3 months ago.

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

0%

Category:Gantt
Target version:4.0.3
Resolution:Fixed Affected version:4.0.0

Description

If you set the draw_progress_line option and the draw_related_issues option of the custom query to true, you can not change it to false from the screen.

I think this problem is due to the influence of #29701.

options.png (105 KB) Mizuki ISHIKAWA, 2019-03-20 03:41


Related issues

Related to Redmine - Defect #29701: Custom queries are broken by updating with nil parameter ... Closed

Associated revisions

Revision 18015
Added by Jean-Philippe Lang 3 months ago

Cannot uncheck Gantt chart options of a custom query (#31063).

Patch by Mizuki ISHIKAWA.

Revision 18019
Added by Jean-Philippe Lang 3 months ago

Merged r18015 to 4.0-stable (#31063).

History

#1 Updated by Mizuki ISHIKAWA 3 months ago

I think that the cause is that the parameter is nil when the check box is false.
The solution is to make the parameter '0' if the checkbox is false by the hidden tag.

diff --git a/app/views/queries/_form.html.erb b/app/views/queries/_form.html.erb
index f424e103cd..7f79906efb 100644
--- a/app/views/queries/_form.html.erb
+++ b/app/views/queries/_form.html.erb
@@ -40,6 +40,8 @@
 <% else %>
 <fieldset id="options"><legend><%= l(:label_options) %></legend>
   <p><label><%= l(:button_show) %></label>
+  <%= hidden_field_tag 'query[draw_relations]', '0' %>
+  <%= hidden_field_tag 'query[draw_progress_line]', '0' %>
   <label class="inline"><%= check_box_tag "query[draw_relations]", "1", @query.draw_relations %> <%= l(:label_related_issues) %></label>
   <label class="inline"><%= check_box_tag "query[draw_progress_line]", "1", @query.draw_progress_line %> <%= l(:label_gantt_progress_line) %></label>
   </p>

#2 Updated by Go MAEDA 3 months ago

  • Target version set to Candidate for next minor release

#3 Updated by Go MAEDA 3 months ago

  • Related to Defect #29701: Custom queries are broken by updating with nil parameter values added

#4 Updated by Go MAEDA 3 months ago

  • Target version changed from Candidate for next minor release to 4.0.3

Setting the target version to 4.0.3.

#5 Updated by Jean-Philippe Lang 3 months ago

  • Subject changed from Can't change Ganttchart options of custom query to false to Can't uncheck Gantt chart options of custom queries
  • Category set to Gantt
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

#6 Updated by Jean-Philippe Lang 3 months ago

Committed, thanks.

#7 Updated by Jean-Philippe Lang 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF