Skip to content

Commit

Permalink
Merge pull request #5866 from nextcloud/backport/5863/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(locks): only lock when editing
  • Loading branch information
max-nextcloud authored Jun 7, 2024
2 parents 7716d7d + 17b12d3 commit 0e947d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Service/ApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,11 @@ public function create(?int $fileId = null, ?string $filePath = null, ?string $b
$lockInfo = null;
}

$isLocked = $this->documentService->lock($file->getId());
if (!$isLocked) {
$readOnly = true;
if (!$readOnly) {
$isLocked = $this->documentService->lock($file->getId());
if (!$isLocked) {
$readOnly = true;
}
}

return new DataResponse([
Expand Down

0 comments on commit 0e947d0

Please sign in to comment.