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

quick fix issue when no custom field is enabled for a project

Jonas Jabarif3b0460e5a15
diff --git a/modules/overviews/app/components/project_custom_fields/sidebar_component.html.erb b/modules/overviews/app/components/project_custom_fields/sidebar_component.html.erb
index 43669a2f995..94307c34265 100644
--- a/modules/overviews/app/components/project_custom_fields/sidebar_component.html.erb
+++ b/modules/overviews/app/components/project_custom_fields/sidebar_component.html.erb
@@ -1,14 +1,16 @@
<%=
content_tag("turbo-frame", id: "project-attributes-sidebar") do
component_wrapper do
- flex_layout do |sections_container|
- @active_project_custom_fields_grouped_by_section.each do |project_custom_field_section_id, project_custom_fields|
- sections_container.with_row(mb: 3) do
- render(ProjectCustomFields::Sections::ShowComponent.new(
- project: @project,
- project_custom_field_section: get_eager_loaded_project_custom_field_section(project_custom_field_section_id),
- project_custom_fields: project_custom_fields
- ))
+ if @active_project_custom_fields_grouped_by_section.any?
+ flex_layout do |sections_container|
+ @active_project_custom_fields_grouped_by_section.each do |project_custom_field_section_id, project_custom_fields|
+ sections_container.with_row(mb: 3) do
+ render(ProjectCustomFields::Sections::ShowComponent.new(
+ project: @project,
+ project_custom_field_section: get_eager_loaded_project_custom_field_section(project_custom_field_section_id),
+ project_custom_fields: project_custom_fields
+ ))
+ end
end
end
end