Closed (fixed)
Project:
Facebook Like Button
Version:
6.x-1.6
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
1 Aug 2011 at 19:44 UTC
Updated:
29 Mar 2012 at 20:27 UTC
Jump to comment: Most recent file
Since I installed this module on a site, and enabled it for a particular content type ("blog"), and then clicked "Like" on a particular blog post to test, it seems that every new blog post is automatically displayed as "Like"d by me. This is only on the Drupal side, though -- my Facebook profile does not list "Like"s for each of the items. What could be going wrong?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | fblikebutton-for-teasers.patch | 621 bytes | noelbush |
Comments
Comment #1
noelbush commentedOkay, here's a clue: the duplicate "Like" status is only for teasers on the front page of the site. It doesn't occur when you look at an individual node's page.
Comment #2
noelbush commentedHere is the problem, very simple. Line 32 of fblikebutton.module, in
fblikebutton_nodeapi(), sets$likepathtodrupal_get_path_alias($_GET['q']). So, of course, when viewing the front page, this just gets the path to the front page, not whatever node is being rendered. Instead, it should be:This seems to work right now.
Comment #3
antiyouth commentedThanks for posting this, noelbush. I'm running a backport of the module on Drupal 5 (I have to update an existing client's site), maybe that's the issue, but I'm not getting this to work, it still affects all the nodes on the page instead of the one that I clicked "Like" on. Not sure if this helps, but here's the a portion of my code with your replacement:
function fblikebutton_nodeapi(&$node, $op, $teaser, $page) {
global $user, $base_url;
$likebase = $base_url . '/';
$likepath = drupal_get_path_alias($node->path);
$webpage_to_like = $likebase . $likepath;
When I printed out $likepath, there was no value. Any thoughts/suggestions? Thanks in any case! I'll keep poking around, and if I figure it out, I'll post to here.
Comment #4
antiyouth commentedOkay, I tried something else.
Instead of:
$likepath = drupal_get_path_alias($node->path);
I tried this:
$likepath = url(drupal_get_path_alias( 'node/' . $node->nid));
Not sure if this passes Drupal muster, but at least on my test site, it seems like work like a charm. Thanks, wouldn't have gotten there without this thread.
Comment #5
antiyouth commentedfyi, here's the backport of the module for Drupal 5: http://drupal.org/node/1183632
Comment #6
jerdiggity commentedThis issue was resolved in the dev version... Will commit to next release as well.
Comment #7
dmsmidtNew releases are out.
Marking as fixed.