From 59e4e4bfba4e4b9fede3b743adedce668dcd0110 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=B4me=20Chilliet?= Date: Mon, 7 Oct 2024 15:36:53 +0200 Subject: [PATCH] fix(sharebymail): Fix share update when node id changed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This fixes transfering an email share from a user to another one when using objectstore as primary storage. Signed-off-by: Côme Chilliet --- apps/sharebymail/lib/ShareByMailProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index fd43e7c089e..7b8066e6f77 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -739,11 +739,14 @@ class ShareByMailProvider extends DefaultShareProvider implements IShareProvider $shareAttributes = $this->formatShareAttributes($share->getAttributes()); /* - * We allow updating the permissions and password of mail shares + * We allow updating mail shares */ $qb = $this->dbConnection->getQueryBuilder(); $qb->update('share') ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))) + ->set('item_source', $qb->createNamedParameter($share->getNode()->getId())) + ->set('file_source', $qb->createNamedParameter($share->getNode()->getId())) + ->set('share_with', $qb->createNamedParameter($share->getSharedWith())) ->set('permissions', $qb->createNamedParameter($share->getPermissions())) ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner())) ->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy())) -- 2.39.5