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

Fixing a bug when there only one line or one section planes defined

Wieland Lindenthaldd9605ab755e
diff --git a/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb b/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb
index c5553ccc565..40bbd102ec2 100644
--- a/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb
+++ b/modules/bim/lib/open_project/bim/bcf_json/viewpoint_reader.rb
@@ -97,7 +97,7 @@ module OpenProject::Bim
def transform_lines(hash)
return unless hash['lines']
- hash['lines'] = hash['lines']['line'].map! do |line|
+ hash['lines'] = [hash['lines']['line']].flatten(1).map! do |line|
line.deep_transform_values! { |val| to_numeric(val) }
end
end
@@ -105,7 +105,7 @@ module OpenProject::Bim
def transform_clipping_planes(hash)
return unless hash['clipping_planes']
- hash['clipping_planes'] = hash['clipping_planes']['clipping_plane'].map! do |plane|
+ hash['clipping_planes'] = [hash['clipping_planes']['clipping_plane']].flatten(1).map! do |plane|
plane.deep_transform_values! { |val| to_numeric(val) }
end
end