Hello All,
In K2 Item display the tags list is displayed by id rather than Alphabetically. Not sure if this is a "bug" but the SQL code in models/item.php getItemTags, line 694, should be:
$query="SELECT `id`, `name` FROM #__k2_tags as tags WHERE tags.published=1 AND tags.id IN (SELECT `tagID` FROM #__k2_tags_xref WHERE `itemID`={$itemID}) order by `name`";
Also in the administration area change the following functions in models/item.php...
function getAvailableTags($itemID = NULL) {
$db = &JFactory::getDBO(); $query = "SELECT * FROM #__k2_tags as tags"; if (!is_null($itemID)) $query .= " WHERE tags.id NOT IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID={$itemID})"; $query .= " ORDER BY `name`"; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows; }
function getCurrentTags($itemID) {
$db = &JFactory::getDBO(); $query = "SELECT * FROM #__k2_tags as tags WHERE tags.id IN (SELECT tagID FROM #__k2_tags_xref WHERE itemID={$itemID}) ORDER BY `name`"; $db->setQuery($query); $rows = $db->loadObjectList(); return $rows; }
Jw