Topic-icon Some problems with FB like and K2 items

Support Specialist
13 years 8 months ago #26741 by alzander
Peter,
We had a chance to investigate the problem more today and realize it'a home-page specific issue we haven't seen or heard of before. We're doing more investigation on our side and will hopefully have an answer within a day or two now. The good news is that since we understand how it's happening on your site, we should hopefully be able to easily recreate and fix going forward.

Just so you know, what seems to be happening is that 'normal' K2 articles from a menu item include the menu item name in the URL. You can see this if you go to your /preview hidden menu item.. the articles have preview in the URL and the Like buttons look to work properly. From the home page though, there is no menu name in the URL, so when we generate the URL, it seems to be inserting /component/k2/... for some reason.

Again, that's seems to be the cause, now we need to find the solution, and we'll keep you posted on that. We had a very, very busy 2 weeks, and things are getting back to normal now, so we should be able to get you something in the next day or so (pending we can easily recreate it on our dev sites).

Thanks,
Alex
The topic has been locked.
Support Specialist
13 years 8 months ago #26763 by alzander
Peter,
We have a possible solution that takes 1 line of code to change and implement. We have only tested against your use case and it works on the home page, but not sure if this is going to cause issues on other types of views (Item View, etc). We'll do more testing on it as well, but if you have any results you can share on whether it works as expected and, especially, if it causes other issues, that would be great to know.

The change is in the /libraries/sourcecoast/articleContent.php file. Around line 200, you'll see the following block of code:
private static function _getCurrentItemURL($article)
    {
        require_once(JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php');
        $url = K2HelperRoute::getItemRoute($article->id . ":" . urlencode($article->alias), $article->catid);
        $url = SCArticleContent::_getCompleteURL($url);
        return $url;
    }
Change the first $url = line so that it looks like below (adding the $article->catid portion at the end):
$url = K2HelperRoute::getItemRoute($article->id . ":" . urlencode($article->alias), $article->catid);

Again, please test, a lot, and let us know how it goes!

Good luck,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 8 months ago #26765 by Peter072
That did the trick!!
Thank you very much, my customer is a happy man now :D
I have tried every page and it all seems to work nicely.

I have only one question now: is there an easy way overlook all FB comments on our site? To see if and where someone hve written on our site?
The topic has been locked.
Support Specialist
13 years 8 months ago #26767 by alzander
Awesome! Very sorry for the delay in all this. We'll keep doing testing and already have this issue in our tracker, so we'll be including it in the next release if it doesn't seem to cause other issues.

As for seeing all comments, you can use Facebook's moderate tool. It's not perfect, but should get the job done for what you're looking for:
developers.facebook.com/tools/comments

If that doesn't work for you (it doesn't for some people), let us know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 8 months ago #26768 by Peter072
hm.. that link led to a blank page. Its not active any more?
The topic has been locked.
Active Subscriptions:

None
13 years 8 months ago #26786 by Peter072
Ah ofcorse! I was not logged in with my customers facebook :p
If I could have seen what page those comments was made, that would have been all I needed. But if that is the best I get it will have to do..
The topic has been locked.
Active Subscriptions:

None
13 years 8 months ago #26787 by Peter072
Ah I see now that I can! Just click on the date stamp and you get there :)
Thanks for the tip :)
The topic has been locked.
Support Specialist
13 years 8 months ago #26801 by alzander
Glad you got it going. It's not the most perfect way to read all comments, but is great for scanning for garbage/spam comments at least.

Hope that helps, and should you need anything else, just let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It's not required, but certainly appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and good luck,
Alex
The topic has been locked.