aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-05-11 09:54:15 +0200
committerGitHub <noreply@github.com>2023-05-11 09:54:15 +0200
commit2d41f0c0640f6aba072810ca8fd6425d92cad70b (patch)
tree21313d40405332f0cd63bdf40e54ba6ac2fe2d9f
parentdb026840082432f8b851171a8f0e8374de818ee1 (diff)
parente20e18f45f5bb06cc82e34169317079bf99f5b58 (diff)
downloadnextcloud-server-2d41f0c0640f6aba072810ca8fd6425d92cad70b.tar.gz
nextcloud-server-2d41f0c0640f6aba072810ca8fd6425d92cad70b.zip
Merge pull request #38067 from nextcloud/fix/noid/sortTags
fix: sort tags by name
-rw-r--r--apps/dav/lib/SystemTag/SystemTagPlugin.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/dav/lib/SystemTag/SystemTagPlugin.php b/apps/dav/lib/SystemTag/SystemTagPlugin.php
index c5c828cfbff..3c834bf71eb 100644
--- a/apps/dav/lib/SystemTag/SystemTagPlugin.php
+++ b/apps/dav/lib/SystemTag/SystemTagPlugin.php
@@ -34,6 +34,7 @@ use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTagObjectMapper;
use OCP\SystemTag\TagAlreadyExistsException;
+use OCP\Util;
use Sabre\DAV\Exception\BadRequest;
use Sabre\DAV\Exception\Conflict;
use Sabre\DAV\Exception\Forbidden;
@@ -306,8 +307,11 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
if ($user === null) {
return;
}
-
+
$tags = $this->getTagsForFile($node->getId(), $user);
+ usort($tags, function (ISystemTag $tagA, ISystemTag $tagB): int {
+ return Util::naturalSortCompare($tagA->getName(), $tagB->getName());
+ });
return new SystemTagList($tags, $this->tagManager, $user);
});
}