Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#60023] Error on applying filter changes in Cost Reports

as-op82d62ff7ae10
diff --git a/modules/reporting/app/controllers/cost_reports_controller.rb b/modules/reporting/app/controllers/cost_reports_controller.rb
index 80cefdf73c9..ff0cf12964a 100644
--- a/modules/reporting/app/controllers/cost_reports_controller.rb
+++ b/modules/reporting/app/controllers/cost_reports_controller.rb
@@ -174,12 +174,14 @@ class CostReportsController < ApplicationController
# Update a record with new query parameters and save it. Redirects to the
# specified record or renders the updated table on XHR
def update
- if params[:set_filter].to_i == 1 # save
+ if set_filter? # apply
old_query = @query
prepare_query
- old_query.migrate(@query)
- old_query.save!
- @query = old_query
+ if old_query
+ old_query.migrate(@query)
+ old_query.save!
+ @query = old_query
+ end
end
if request.xhr?
table