|
I'm using K2 from joomlaworks and i have problem when try to add tags from joomla FE, i received every time "You need to enter a tag!" .
With JomSEF disable the problem is not present.
I think that the problem is on this piece of code that is present on /administrator/components/com_k2/models/tag.php, i think that the problem is on the red code
function addTag(){
global $mainframe;
$tag=JRequest::getString('tag');
$response = new JObject;
$response->set('name',$tag);
require_once(JPATH_COMPONENT_ADMINISTRATOR.DS.'lib'.DS.'JSON.php');
$json=new Services_JSON;
if (empty($tag)){
$response->set('msg',JText::_('You need to enter a tag!',true));
echo $json->encode($response);
$mainframe->close();
}
$db = & JFactory::getDBO();
$query = "SELECT COUNT(*) FROM #__k2_tags WHERE name=".$db->Quote($tag);
$db->setQuery($query);
$result = $db->loadResult();
if ($result>0){
$response->set('msg',JText::_('Tag already exists!',true));
echo $json->encode($response);
$mainframe->close();
}
$row = & JTable::getInstance('K2Tag', 'Table');
$row->name=$tag;
$row->published=1;
$row->store();
$cache = & JFactory::getCache('com_k2');
$cache->clean();
$response->set('id', $row->id);
$response->set('status','success');
$response->set('msg', JText::_('Tag added!',true));
echo $json->encode($response);
$mainframe->close();
}
could you verify ?
|
Problem with K2 and ...
|
Posted 15 years, 6 months ago
by Falco
|