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

[#58635] fixed details form for custom fields

Eric Schubert5f5c53ff602f
diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb
index de3a72af308..2beb4cfd0ff 100644
--- a/app/controllers/custom_fields_controller.rb
+++ b/app/controllers/custom_fields_controller.rb
@@ -71,7 +71,7 @@ class CustomFieldsController < ApplicationController
end
def check_custom_field
- # ProjecCustomFields now managed in a different UI
+ # ProjectCustomFields now managed in a different UI
if @custom_field.nil? || @custom_field.type == "ProjectCustomField"
flash[:error] = "Invalid CF type"
redirect_to action: :index
diff --git a/app/forms/custom_fields/details_form.rb b/app/forms/custom_fields/details_form.rb
index 0ad82ccba63..096d55ced7d 100644
--- a/app/forms/custom_fields/details_form.rb
+++ b/app/forms/custom_fields/details_form.rb
@@ -44,7 +44,7 @@ module CustomFields
)
details_form.check_box(
- name: :required,
+ name: :is_required,
label: I18n.t("activerecord.attributes.custom_field.is_required"),
caption: I18n.t("custom_fields.instructions.is_required")
)
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index a3902325a1d..c34fdb7299b 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -289,14 +289,14 @@ class CustomField < ApplicationRecord
field_format == "bool"
end
- def multi_value_possible?
- version? || user? || list?
- end
-
def field_format_hierarchy?
field_format == "hierarchy"
end
+ def multi_value_possible?
+ version? || user? || list? || field_format_hierarchy?
+ end
+
def allow_non_open_versions_possible?
version?
end