Skip to content

Commit 96cdd2d

Browse files
authored
Merge pull request #5867 from nextcloud/backport/5863/stable27
[stable27] fix(locks): only lock when editing
2 parents a4f9662 + 5bd871c commit 96cdd2d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lib/Service/ApiService.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,11 @@ public function create(?int $fileId = null, ?string $filePath = null, ?string $b
164164
$lockInfo = null;
165165
}
166166

167-
$isLocked = $this->documentService->lock($file->getId());
168-
if (!$isLocked) {
169-
$readOnly = true;
167+
if (!$readOnly) {
168+
$isLocked = $this->documentService->lock($file->getId());
169+
if (!$isLocked) {
170+
$readOnly = true;
171+
}
170172
}
171173

172174
return new DataResponse([

0 commit comments

Comments
 (0)