diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index d4f89492854eb..4a29e9b473080 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -744,6 +744,7 @@ public function getShares( * @param string $publicUpload * @param string $expireDate * @param string $note + * @param string $label * @return DataResponse * @throws LockedException * @throws NotFoundException @@ -758,7 +759,8 @@ public function updateShare( string $sendPasswordByTalk = null, string $publicUpload = null, string $expireDate = null, - string $note = null + string $note = null, + string $label = null ): DataResponse { try { $share = $this->getShareById($id); @@ -772,7 +774,14 @@ public function updateShare( throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist')); } - if ($permissions === null && $password === null && $sendPasswordByTalk === null && $publicUpload === null && $expireDate === null && $note === null) { + if ($permissions === null && + $password === null && + $sendPasswordByTalk === null && + $publicUpload === null && + $expireDate === null && + $note === null && + $label === null + ) { throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given')); } @@ -849,6 +858,10 @@ public function updateShare( $share->setPassword($password); } + if ($label !== null) { + $share->setLabel($label); + } + } else { if ($permissions !== null) { $permissions = (int)$permissions; diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index ce3e9ae795cd2..f4b2ab9b6799e 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -301,6 +301,7 @@ public function update(\OCP\Share\IShare $share) { ->set('token', $qb->createNamedParameter($share->getToken())) ->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE)) ->set('note', $qb->createNamedParameter($share->getNote())) + ->set('label', $qb->createNamedParameter($share->getLabel())) ->execute(); }