Follow us on Twitter

1. Check the Documentation

2. Make a search

3. Read Support Rules
before posting

  • Index
  • » AceSEF
  • » Hacks, Tricks and Tips
  • » K2 articles sent to wrong path......

K2 articles sent to wrong path... - Forums Task Topic P 1 Id 6798

K2 articles sent to wrong path... - Forums Task Topic P 1 Id 6798

K2 articles sent to wrong path... issue coming from jcomments...
#1 Top

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

Randy Arrowood
PRO Customer
useravatar
Offline
1 Posts
User info in posts
Administrator has disabled public posting
  • Index
  • » AceSEF
  • » Hacks, Tricks and Tips
  • » K2 articles sent to wrong path......