mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
fix: sort tags by name
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
527de8ac9d
commit
badee49b4b
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
@ -34,6 +35,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 +308,11 @@ class SystemTagPlugin extends \Sabre\DAV\ServerPlugin {
|
|||
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);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue