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

Use polymorphic_path for redirect

Klaus Zanders3a7f955c4f16
diff --git a/modules/costs/app/controllers/costlog_controller.rb b/modules/costs/app/controllers/costlog_controller.rb
index e81b8a6b912..7589f4c8b4a 100644
--- a/modules/costs/app/controllers/costlog_controller.rb
+++ b/modules/costs/app/controllers/costlog_controller.rb
@@ -57,7 +57,7 @@ class CostlogController < ApplicationController
elsif @cost_entry.save
flash[:notice] = t(:notice_cost_logged_successfully)
- redirect_back_or_default work_package_path(@cost_entry.entity)
+ redirect_back_or_default polymorphic_path(@cost_entry.entity)
else
render action: :edit, status: :unprocessable_entity
end