Skip to content

Commit

Permalink
fix(systemtags): sort tags on dav response
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
  • Loading branch information
tobiasKaminsky authored and skjnldsv committed May 4, 2023
1 parent 5938808 commit 612c279
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/dav/lib/SystemTag/SystemTagList.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public static function xmlDeserialize(Reader $reader): void {
}

public function xmlSerialize(Writer $writer): void {
// Sort the tags by name
usort($this->tags, function($tag1, $tag2) {
return strnatcmp($tag1->getName(), $tag2->getName());
});

foreach ($this->tags as $tag) {
$writer->startElement('{' . self::NS_NEXTCLOUD . '}system-tag');
$writer->writeAttributes([
Expand Down

0 comments on commit 612c279

Please sign in to comment.