From 625f0777d043b9c348b5b41d0657fbfb652a9785 Mon Sep 17 00:00:00 2001 From: Enrico Zamprogno Date: Wed, 8 Feb 2023 12:15:55 +0100 Subject: [PATCH] Sort tag list by name ascending It is very inconvenient to find the desired tag when the list is very long. This makes it easier to explore the set of available tags --- administrator/components/com_k2/models/item.php | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/components/com_k2/models/item.php b/administrator/components/com_k2/models/item.php index 9e2aa44b..8c05a535 100644 --- a/administrator/components/com_k2/models/item.php +++ b/administrator/components/com_k2/models/item.php @@ -984,6 +984,7 @@ public function getAvailableTags($itemID = null) if (!is_null($itemID)) { $query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID=".(int) $itemID.")"; } + $query .= " ORDER BY name ASC"; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows;