Deleted folder (still in trash) results in errors while accessing parent folder via webdav #404

This commit is contained in:
Karel Pičman 2015-07-13 12:38:55 +02:00
parent 294e39836c
commit f9db08b8fd

View File

@ -132,7 +132,7 @@ module RedmineDmsf
# If folder is false, means it couldn't pick up parent,
# as such its probably fine to bail out, however we'll
# perform a search in this scenario
files = DmsfFile.visible.where(:project_id => project.id, :name => basename).order('name ASC').all
files = DmsfFile.visible.where(:project_id => project.id, :name => basename).order('name ASC').to_a
files.delete_if {|x| File.dirname('/' + x.dmsf_path_str) != File.dirname(projectless_path)}
if files.length > 0
@file = files[0]