Incomplete copy of a file to another project #651

This commit is contained in:
Karel Picman 2017-02-09 12:38:39 +01:00
parent a71078112a
commit 15a0c89eb4
2 changed files with 3 additions and 4 deletions

View File

@ -22,6 +22,7 @@ Changelog for Redmine DMSF
Global title format for downloading
New columns in the main DMSF view; columns are configurable from the plugin settings
* Bug: #651 - Incomplete copy of a file to another project
* New: #641 - Documents export
* New: #635 - Edit approval workflow steps
* Bug: #632 - database migration error (from ver 0.9.1 to ver 1.5.8)

View File

@ -277,10 +277,8 @@ class DmsfFile < ActiveRecord::Base
project = container.is_a?(Project) ? container : container.project
# If the target project differs from the source project we must physically move the disk files
if self.project != project
self.dmsf_file_revisions.all.each do |rev|
if File.exist? rev.disk_file(self.project)
FileUtils.cp rev.disk_file(self.project), rev.disk_file(project)
end
if File.exist? self.last_revision.disk_file(self.project)
FileUtils.cp self.last_revision.disk_file(self.project), self.last_revision.disk_file(project)
end
end
file = DmsfFile.new