From 848c5b78e10cade4f6bc9358be8b8224665af944 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 11 Jun 2020 19:23:50 +0100 Subject: [PATCH] drive: fix not being able to delete a directory with a trashed shortcut When we resolve the shortcut we now propagate the trashed status of the shortcut into the resolved item which fixes the issue. --- backend/drive/drive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/drive/drive.go b/backend/drive/drive.go index 81446cdba..ec0aa1c5f 100755 --- a/backend/drive/drive.go +++ b/backend/drive/drive.go @@ -1972,9 +1972,10 @@ func (f *Fs) resolveShortcut(item *drive.File) (newItem *drive.File, err error) if err != nil { return nil, errors.Wrap(err, "failed to resolve shortcut") } - // make sure we use the Name and Parents from the original item + // make sure we use the Name, Parents and Trashed from the original item newItem.Name = item.Name newItem.Parents = item.Parents + newItem.Trashed = item.Trashed // the new ID is a composite ID newItem.Id = joinID(newItem.Id, item.Id) return newItem, nil