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

fixed redirect issue when deleting custom options

Jonas Jabarid38f22c94785
diff --git a/app/controllers/admin/settings/project_custom_fields_controller.rb b/app/controllers/admin/settings/project_custom_fields_controller.rb
index 617b6cc23ca..526c449e3bb 100644
--- a/app/controllers/admin/settings/project_custom_fields_controller.rb
+++ b/app/controllers/admin/settings/project_custom_fields_controller.rb
@@ -107,14 +107,6 @@ module Admin::Settings
private
- def edit_path(id:)
- admin_settings_project_custom_field_path(id:)
- end
-
- def index_path(params = {})
- admin_settings_project_custom_fields_path(**params)
- end
-
def set_sections
@project_custom_field_sections = ProjectCustomFieldSection
.includes(custom_fields: :project_custom_field_project_mappings)
diff --git a/app/controllers/concerns/custom_fields/shared_actions.rb b/app/controllers/concerns/custom_fields/shared_actions.rb
index f84db04f366..be8da8be6a4 100644
--- a/app/controllers/concerns/custom_fields/shared_actions.rb
+++ b/app/controllers/concerns/custom_fields/shared_actions.rb
@@ -32,13 +32,19 @@ module CustomFields
included do
def index_path(params = {})
- # default path below, can be overridden in the including controller
- custom_fields_path(**params)
+ if @custom_field.type == 'ProjectCustomField'
+ admin_settings_project_custom_fields_path(**params)
+ else
+ custom_fields_path(**params)
+ end
end
def edit_path(params = {})
- # default path below, can be overridden in the including controller
- edit_custom_field_path(**params)
+ if @custom_field.type == 'ProjectCustomField'
+ admin_settings_project_custom_field_path(**params)
+ else
+ edit_custom_field_path(**params)
+ end
end
def create