aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-07 15:36:53 +0200
committerCôme Chilliet <91878298+come-nc@users.noreply.github.com>2024-10-15 14:37:49 +0200
commit54905c39238c38dba04ba77d85b2349e76c0abd3 (patch)
tree0555d775681e4a93ebed07d6bb05f7d6a0e7239b
parent3a6d4ae3aa4c76acec286191205159671cd84f29 (diff)
downloadnextcloud-server-54905c39238c38dba04ba77d85b2349e76c0abd3.tar.gz
nextcloud-server-54905c39238c38dba04ba77d85b2349e76c0abd3.zip
fix(sharebymail): Fix share update when node id changed
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>
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index b21f6440c64..556c7fafd6f 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -738,11 +738,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()))