From 37109d184f524db796b0d06448afafeef7c2511d Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Tue, 6 Feb 2024 18:12:19 +0100 Subject: [PATCH] fix an error when move using destination id --- changelog/unreleased/fix-move.md | 6 ++++++ internal/http/services/owncloud/ocdav/move.go | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-move.md diff --git a/changelog/unreleased/fix-move.md b/changelog/unreleased/fix-move.md new file mode 100644 index 00000000000..f408abc5df5 --- /dev/null +++ b/changelog/unreleased/fix-move.md @@ -0,0 +1,6 @@ +Bugfix: Fix an error when move + +We fixed a bug that caused Internal Server Error when move using destination id + +https://github.com/cs3org/reva/pull/4503 +https://github.com/owncloud/ocis/issues/6739 diff --git a/internal/http/services/owncloud/ocdav/move.go b/internal/http/services/owncloud/ocdav/move.go index fbd51ee72fa..0c65ebb1ed2 100644 --- a/internal/http/services/owncloud/ocdav/move.go +++ b/internal/http/services/owncloud/ocdav/move.go @@ -266,7 +266,11 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req } // TODO what if intermediate is a file? } - + // resolve the destination path + if dst.Path == "." { + dst.Path = utils.MakeRelativePath(dstStatRes.GetInfo().GetName()) + dst.ResourceId = dstStatRes.GetInfo().ParentId + } mReq := &provider.MoveRequest{Source: src, Destination: dst} mRes, err := client.Move(ctx, mReq) if err != nil {