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

[#64347] controller checks feature flag

Tobias Dillmann35954c7eb1aa
diff --git a/app/controllers/admin/settings/project_custom_field_calculated_values_controller.rb b/app/controllers/admin/settings/project_custom_field_calculated_values_controller.rb
index 41e71cf75fd..4c591e4296d 100644
--- a/app/controllers/admin/settings/project_custom_field_calculated_values_controller.rb
+++ b/app/controllers/admin/settings/project_custom_field_calculated_values_controller.rb
@@ -36,6 +36,8 @@ module Admin::Settings
include FlashMessagesOutputSafetyHelper
include Admin::Settings::ProjectCustomFields::ComponentStreams
+ before_action :check_feature_flag
+
menu_item :project_custom_fields_settings
def show
@@ -52,7 +54,13 @@ module Admin::Settings
end
def edit
- @custom_field = ProjectCustomField.find(params[:id])
+ @custom_field = ProjectCustomField.find_by(id: params[:id], field_format: "calculated_value")
+ end
+
+ private
+
+ def check_feature_flag
+ render_404 unless OpenProject::FeatureDecisions.calculated_value_project_attribute_active?
end
end
end