diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 9b7dfe48dcb3d..f05dae9752a85 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -678,8 +678,8 @@ public function update(IShare $share, ?string $plainTextPassword = null): IShare $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('item_source', $qb->createNamedParameter($share->getNodeId())) + ->set('file_source', $qb->createNamedParameter($share->getNodeId())) ->set('share_with', $qb->createNamedParameter($share->getSharedWith())) ->set('permissions', $qb->createNamedParameter($share->getPermissions())) ->set('uid_owner', $qb->createNamedParameter($share->getShareOwner())) diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php index 1f9034950b730..988d6d8630f2f 100644 --- a/apps/sharebymail/tests/ShareByMailProviderTest.php +++ b/apps/sharebymail/tests/ShareByMailProviderTest.php @@ -643,6 +643,8 @@ public function testUpdate() { $this->share->expects($this->once())->method('getSharedBy')->willReturn($sharedBy); $this->share->expects($this->any())->method('getNote')->willReturn($note); $this->share->expects($this->atLeastOnce())->method('getId')->willReturn($id); + $this->share->expects($this->atLeastOnce())->method('getNodeId')->willReturn($itemSource); + $this->share->expects($this->once())->method('getSharedWith')->willReturn($shareWith); $this->assertSame($this->share, $instance->update($this->share)