- Index
- » AceSEF
- » Hacks, Tricks and Tips
- » K2 articles sent to wrong path......
Page:
1
K2 articles sent to wrong path... issue coming from jcomments...
K2 articles sent to wrong path... issue coming from jcomments...
K2 articles sent to wrong path... issue coming from jcomments...
I was getting too many duplicate URLs being generated and causing issues. For some reason, the K2 plugin for jcomments was building links to the wrong menu item for my K2 articles... So, I reached out for help from AceSEF and their tool was great to identify the source coming from:
/components/com_jcomments/plugins/com_k2.plugin.php
So, I edited that file and changed the function to read:
Code:
function getObjectLink($id)
{
require_once (JPath::clean( JPATH_SITE.'/components/com_k2/helpers/route.php'));
$db = & JCommentsFactory::getDBO();
$db->setQuery( 'SELECT alias FROM jos_k2_items WHERE id = ' . $id );
$alias = $db->loadResult();
$link = JRoute::_(K2HelperRoute::getItemRoute($id.':'.$alias));
Hope that helps someone
Administrator has disabled public posting
Page:
1
- Index
- » AceSEF
- » Hacks, Tricks and Tips
- » K2 articles sent to wrong path......
