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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Correctly pass the filename to the UploadedFile
Oliver Günther0e8f96bb1851
diff --git a/lib/api/v3/attachments/attachment_parsing_representer.rb b/lib/api/v3/attachments/attachment_parsing_representer.rbindex 34c37354896..563d496ce0d 100644--- a/lib/api/v3/attachments/attachment_parsing_representer.rb+++ b/lib/api/v3/attachments/attachment_parsing_representer.rb@@ -35,12 +35,6 @@ module APImodule V3module Attachmentsclass AttachmentParsingRepresenter < ::API::Decorators::Single- property :file,- setter: ->(fragment:, **) {- self.file = OpenProject::Files.build_uploaded_file fragment[:tempfile],- fragment[:type]- }-nested :metadata doproperty :filename,as: :fileName@@ -63,6 +57,14 @@ module APIproperty :digest,render_nil: falseend++ property :file,+ setter: ->(fragment:, represented:, doc:, **) {+ filename = represented.filename || doc.dig('metadata', 'fileName')+ self.file = OpenProject::Files.build_uploaded_file fragment[:tempfile],+ fragment[:type],+ file_name: filename+ }endendend