Skip to content

Commit 2f66178

Browse files
authored
Merge pull request #1260 from nextcloud/fix/notes-folder-conflict
fix: Avoid conflicts on notes folder creation
2 parents 395fb08 + a5bec1a commit 2f66178

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Service/NoteUtil.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder {
167167
} elseif ($create) {
168168
$folder = $this->root->newFolder($path);
169169
}
170+
171+
if ($folder->isShared()) {
172+
$folderName = $this->root->getNonExistingName($path);
173+
$folder = $this->root->newFolder($folderName);
174+
}
175+
170176
if (!($folder instanceof Folder)) {
171177
throw new NotesFolderException($path.' is not a folder');
172178
}

0 commit comments

Comments
 (0)