Skip to content

Commit

Permalink
fix(sharebymail): Fix share update when node id changed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
come-nc authored and backportbot[bot] committed Oct 8, 2024
1 parent 6300a00 commit cf58e0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/sharebymail/lib/ShareByMailProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,14 @@ public function update(IShare $share, ?string $plainTextPassword = null): IShare
}

/*
* 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()))
Expand Down

0 comments on commit cf58e0f

Please sign in to comment.