Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: sort tags by name
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed May 4, 2023
commit badee49b4b3e8d67c3b264326da7be2d0187846e
7 changes: 6 additions & 1 deletion apps/dav/lib/SystemTag/SystemTagPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
namespace OCA\DAV\SystemTag;

use OC\SystemTag\SystemTag;
use OCA\DAV\Connector\Sabre\Directory;
use OCA\DAV\Connector\Sabre\Node;
use OCP\IGroupManager;
Expand All @@ -34,6 +35,7 @@
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;
Expand Down Expand Up @@ -306,8 +308,11 @@ private function propfindForFile(PropFind $propFind, Node $node): void {
if ($user === null) {
return;
}

$tags = $this->getTagsForFile($node->getId(), $user);
usort($tags, function (SystemTag $tagA, SystemTag $tagB): int {
return Util::naturalSortCompare($tagA->getName(), $tagB->getName());
});
return new SystemTagList($tags, $this->tagManager, $user);
});
}
Expand Down