From 3c453511509f3b7d372fd99a83c46e5216e94c05 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 23 May 2025 15:48:50 +0200 Subject: [PATCH 1/2] fix: Handle share attributes in the share provider Signed-off-by: Julius Knorr --- lib/Sharing/DeckShareProvider.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/Sharing/DeckShareProvider.php b/lib/Sharing/DeckShareProvider.php index 894a6ba923..80ff5da7ca 100644 --- a/lib/Sharing/DeckShareProvider.php +++ b/lib/Sharing/DeckShareProvider.php @@ -48,6 +48,7 @@ use OCP\IL10N; use OCP\Share\Exceptions\GenericShareException; use OCP\Share\Exceptions\ShareNotFound; +use OCP\Share\IAttributes; use OCP\Share\IManager; use OCP\Share\IShare; @@ -150,6 +151,11 @@ public function create(IShare $share) { ) );*/ + // set share attributes + $shareAttributes = $this->formatShareAttributes( + $share->getAttributes() + ); + $shareId = $this->addShareToDB( $share->getSharedWith(), $share->getSharedBy(), @@ -159,7 +165,8 @@ public function create(IShare $share) { $share->getTarget(), $share->getPermissions(), $share->getToken() ?? '', - $share->getExpirationDate() + $share->getExpirationDate(), + $shareAttributes ); $data = $this->getRawShare($shareId); @@ -180,6 +187,7 @@ public function create(IShare $share) { * @param int $permissions * @param string $token * @param \DateTime|null $expirationDate + * @param string|null $attributes * @return int */ private function addShareToDB( @@ -211,6 +219,10 @@ private function addShareToDB( $qb->setValue('expiration', $qb->createNamedParameter($expirationDate, 'datetime')); } + if ($attributes !== null) { + $qb->setValue('attributes', $qb->createNamedParameter($attributes)); + } + $qb->executeStatement(); return $qb->getLastInsertId(); @@ -281,6 +293,9 @@ private function createShareObject(array $data): IShare { $entryData['parent'] = $entryData['f_parent']; $share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, $this->mimeTypeLoader)); } + + $share = $this->updateShareAttributes($share, $data['attributes'] ?? null); + return $share; } From d14bfcacea90be762d0cc5304bb47e09dd485288 Mon Sep 17 00:00:00 2001 From: grnd-alt Date: Tue, 24 Feb 2026 14:29:07 +0100 Subject: [PATCH 2/2] chore: wrap share updates in transaction Signed-off-by: grnd-alt