Skip to content

Commit a1ed79a

Browse files
committed
fix: Add workaround for older server version
The user parameter is added to createTag in recent versions but we need to support 29 and newer. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 parent d57fb90 commit a1ed79a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Migrator/FilesMigrator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ public function import(
339339
}
340340
} catch (TagNotFoundException) {
341341
try {
342+
if (!$this->systemTagManager->canUserCreateTag($user)) {
343+
/* FIXME This should be remove when passing the user to the createTag method is supported by all supported Nextcloud versions */
344+
throw new TagCreationForbiddenException();
345+
}
342346
$systemTagObject = $this->systemTagManager->createTag($systemTag, true, true, $user);
343347
} catch (TagCreationForbiddenException|TagAlreadyExistsException) {
344348
/* Not allowed to create tag or a restricted tag with the same name exists, skip */

0 commit comments

Comments
 (0)