The facebook like button has disappeared recently on nodes pages while it was working properly a few days ago.

After looking at module issues I've found this ticket for Drupal 6's version :
http://drupal.org/node/1509770#comment-5963210

I tried this code and it works so I'm creating same ticket for Drupal 7 with a patch that integrate john.oltman's changes

Comments

jgtrescazes’s picture

Status: Active » Needs review
dmsmidt’s picture

Thanks for writing a patch. However, I can't reproduce the problem in the first place. My instance still works.
Any more clues?

svnindia’s picture

Hi

Read the below thread

http://drupal.org/node/1548260

It may help some one.

thanks,
Svnindia

jgtrescazes’s picture

@svnindia, it seems that "send" parameter is not used anymore when displaying button on iframe mode.
As explained here : http://developers.facebook.com/docs/reference/plugins/like/

send - specifies whether to include a Send button with the Like button. This only works with the XFBML version.

I can't see any difference by calling iframe src with or without this parameter neither by setting it to true or false.

@MrDamasajaga, Is there something like "width=115px&font=arial&height=20px" in your iframe's src ?

wrd’s picture

This change fixed the problem for me as well.

FAAREIA’s picture

Patch doesn't work for me either. I see no difference in erasing 'px' string from width and height values.
Plus, 'send=false' doesn't work either.
Anyone has any clues of what it might be happening??

svnindia’s picture

Hi Stakcreativa ,

Remove the Language text box value.

{snip}
Specific language to use. Default for this site is en_EN. Examples:
French (France): fr_FR
French (Canada): fr_CA
{snip}

Thanks,
svnindia

FAAREIA’s picture

Many thanks svnindia.

For the record....to make it work:
- Apply the patch #0
- Add '&send=false' at line 224, after 'locale={$language}'
- Delete line 223 -> '$language = $conf['language'];'. If i don't delete this line, it does not work. Even if i do not specify a language.

Thanks

FAAREIA’s picture

In fact, you can leave line 223 and delete 'locale={$language}' at line 224.
=)

jgtrescazes’s picture

Instead of erasing locale parameter that can be usefull to force using a language, I think that make it optionnal by changing lines 223 and 224 as below would be cleaner.

  $language = ($conf['language']) ? '&language=' . $conf['language'] : '';
  $params = "href={$webpage_to_like}&layout={$layout}&show_faces={$show_faces}&width={$width}&font={$font}&height={$height}&action={$action}&colorscheme={$colorscheme}{$language}";

You can force send parameter to false too but in my case it works as well with or without it.

FAAREIA’s picture

Many thanks jgtrescazes, your code works perfectly. =)

jgtrescazes’s picture

Here's the patch including those changes

finkenmann’s picture

Perfect. After patching, the button is showing, thanks.

halowind’s picture

- how does one install this patch?

- does it work for v6.1x?

cheers

jgtrescazes’s picture

For D6 version, line numbers are not the same but the piece of code is.

have a look at function _fblikebutton_field() at the end of .module file, you'll find the 2 lines that need to be changed.

lliss’s picture

Status: Needs review » Reviewed & tested by the community

I tested the patch in #12. Looks good and solved the problem. Let's roll this.

daniel wentsch’s picture

Thanks @jgtrescazes,

I had the same problem and your patch (#12) solved it :)

bcurry’s picture

#12 worked for me too. Thanks!

pikot’s picture

#12 This solution worked for me until a few days. But suddenly stopped working. Anyone else?

jgtrescazes’s picture

I got the same, it seems to be caused by show_faces param.
Module set it to show or hide and when I try to generate from : http://developers.facebook.com/docs/reference/plugins/like/,
I get true or false.

I think facebook change it's API again.

I'm starting to write an other patch this afternoon

jgtrescazes’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new2.54 KB

Here's a patch that change those values in the configuration form.
It might be needed to submit again static and dynamic configuration forms for new values being taken into account.

FAAREIA’s picture

Good job jgtrescazes. Patch works for me after i set, again, "Do not show faces".

thanks! =)

pikot’s picture

Thanks jgtrescazes! Patch works perfectly!

Scott McCabe’s picture

I ran the patch ("patch -p1 < fblikebutton-remove_px_on_iframe_src-1570374-21.patch") on a fresh download of the fblikebutton module and got:

"patch: **** malformed patch at line 15: @@ -160,8 +160,8 @@"

Am I missing something?

bcurry’s picture

I also found jgtrescazes patch solved the issue. Although for full disclosure, I did not apply the patch as Scott tried to or by any other textbook method. I just manually cut and pasted the new lines over the old.

jgtrescazes’s picture

Ok I tried last patch only with eclipse and it was applyed without problem.
Here's an other version, generated with "diff" unix command.
Tested successfuly with "patch -p1" on centOS.

lliss’s picture

Version: 7.x-2.0 » 6.x-2.x-dev
Assigned: Unassigned » lliss

This should be fixed in the latest dev branch. Still needs backport to 6.x branch.

ChrisLaFrancis’s picture

This issue, #1664410: button doesn't show because show_faces stores the wrong value, and #1509770: Locale language affects visibility are all more or less the same thing: the like button stops showing up because Facebook has changed its expectations of the parameters that are sent.

jgtrescazes’s picture

I agree with fivefrank several openned issues depend on similar errors. It should be fixed by a global check of settings values according with facebook specifications.
Module fb_social that have an older official release than fblikebutton doesn't have same problems as it provides complient values.
So the change of values in facebook API are not so recent.

Also, as the main feature of fblikebutton is to display a like button and it does not, may be we should set the priority to "critical" in order to get a new offcial release as soon as possible ... don't you think so ?

lliss’s picture

I agree the issue is serious but at least the fix is known. I have updated the 7.x branch and will get to the 6.x branch sometime this week.

lliss’s picture

This has been fixed in the newest version.

lliss’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dmeyerson’s picture

I used the patch in the original post and the button displays now, but only when I'm logged in to facebook. When I'm not logged in, nothing shows up in the content block. My site is hooferouting.org/. Anyone know what the problem could be?

lliss’s picture

This is a support request. I'm moving it over to https://drupal.org/node/2032317

designwebfx’s picture

I was having the same problem so I used every available version and this is the one that worked for Drupal 7: Service Links 7.3-2.3-beta1+3-dev