]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(sharebymail): Fix share update when node id changed
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 7 Oct 2024 13:36:53 +0000 (15:36 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 7 Oct 2024 13:36:53 +0000 (15:36 +0200)
This fixes transfering an email share from a user to another one when using
 objectstore as primary storage.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/sharebymail/lib/ShareByMailProvider.php

index fd43e7c089e9aba0988592799937fdb48daafa2b..7b8066e6f77c5ea85021781f39588ddc10d51ed7 100644 (file)
@@ -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()))