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

[32760] Use redirect_back url to go to correct module

Oliver Güntherc07e44954c46
diff --git a/app/views/work_packages/bulk/destroy.html.erb b/app/views/work_packages/bulk/destroy.html.erb
index 92cfeb84541..6c111d19966 100644
--- a/app/views/work_packages/bulk/destroy.html.erb
+++ b/app/views/work_packages/bulk/destroy.html.erb
@@ -29,6 +29,7 @@ See docs/COPYRIGHT.rdoc for more details.
<%= error_messages_for work_packages.first %>
<%= styled_form_tag work_packages_bulk_path, method: :delete, class: 'form danger-zone' do %>
+ <%= back_url_hidden_field_tag %>
<% work_packages.each do |work_package| %>
<%= hidden_field_tag 'ids[]', work_package.id %>
<% end %>
diff --git a/modules/costs/app/controllers/costlog_controller.rb b/modules/costs/app/controllers/costlog_controller.rb
index f84baac7997..af1a502b541 100644
--- a/modules/costs/app/controllers/costlog_controller.rb
+++ b/modules/costs/app/controllers/costlog_controller.rb
@@ -56,8 +56,7 @@ class CostlogController < ApplicationController
elsif @cost_entry.save
flash[:notice] = t(:notice_cost_logged_successfully)
- redirect_to work_package_path(@cost_entry.work_package)
-
+ redirect_back_or_default work_package_path(@cost_entry.work_package)
else
render action: 'edit'
end