From a1c77107f123f4190c19031d40745d0e485f9fbf Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 14 Oct 2021 17:13:56 +0200 Subject: [PATCH 1/3] Reply to share actions with full path --- changelog/unreleased/full_path_on_share_info.md | 4 ++++ .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 changelog/unreleased/full_path_on_share_info.md diff --git a/changelog/unreleased/full_path_on_share_info.md b/changelog/unreleased/full_path_on_share_info.md new file mode 100644 index 0000000000..51f582b84b --- /dev/null +++ b/changelog/unreleased/full_path_on_share_info.md @@ -0,0 +1,4 @@ +Bugfix: Retrieve the full path of a share when setting as +accepted or on shared by me + +https://github.com/cs3org/reva/pull/2177 \ No newline at end of file diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index afc3252811..0830ddc42b 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -849,11 +849,11 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf s.FileSource = s.ItemSource switch { case s.ShareType == conversions.ShareTypePublicLink: - s.FileTarget = path.Join("/", path.Base(info.Path)) - s.Path = path.Join("/", path.Base(info.Path)) + s.FileTarget = info.Path + s.Path = info.Path case h.sharePrefix == "/": - s.FileTarget = path.Join("/", path.Base(info.Path)) - s.Path = path.Join("/", path.Base(info.Path)) + s.FileTarget = info.Path + s.Path = info.Path default: s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path)) s.Path = path.Join("/", path.Base(info.Path)) From 8ad3bd0bb5d18b568dadca55ad55b44e3cdb5218 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 25 Oct 2021 17:15:12 +0200 Subject: [PATCH 2/3] Change order when deciding whether to keep full paths --- .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index 0830ddc42b..c7006a2f72 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -848,12 +848,12 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf s.ItemSource = wrapResourceID(info.Id) s.FileSource = s.ItemSource switch { - case s.ShareType == conversions.ShareTypePublicLink: - s.FileTarget = info.Path - s.Path = info.Path case h.sharePrefix == "/": s.FileTarget = info.Path s.Path = info.Path + case s.ShareType == conversions.ShareTypePublicLink: + s.FileTarget = path.Join("/", path.Base(info.Path)) + s.Path = path.Join("/", path.Base(info.Path)) default: s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path)) s.Path = path.Join("/", path.Base(info.Path)) From ba2e45d44609a5502bf16b33bcbf0972eec43d78 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Mon, 25 Oct 2021 21:41:35 +0200 Subject: [PATCH 3/3] fix changelog --- .../{full_path_on_share_info.md => full-path-on-share-info.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/unreleased/{full_path_on_share_info.md => full-path-on-share-info.md} (100%) diff --git a/changelog/unreleased/full_path_on_share_info.md b/changelog/unreleased/full-path-on-share-info.md similarity index 100% rename from changelog/unreleased/full_path_on_share_info.md rename to changelog/unreleased/full-path-on-share-info.md