Skip to content

Commit

Permalink
Merge pull request #1260 from nextcloud/fix/notes-folder-conflict
Browse files Browse the repository at this point in the history
fix: Avoid conflicts on notes folder creation
  • Loading branch information
juliushaertl committed Mar 27, 2024
2 parents 395fb08 + a5bec1a commit 2f66178
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Service/NoteUtil.php
Expand Up @@ -167,6 +167,12 @@ public function getOrCreateFolder(string $path, bool $create = true) : Folder {
} elseif ($create) {
$folder = $this->root->newFolder($path);
}

if ($folder->isShared()) {
$folderName = $this->root->getNonExistingName($path);
$folder = $this->root->newFolder($folderName);
}

if (!($folder instanceof Folder)) {
throw new NotesFolderException($path.' is not a folder');
}
Expand Down

0 comments on commit 2f66178

Please sign in to comment.