Download & Extend

Facebook 'Like' button doesn't show in Internet Explorer

Project:Facebook social plugins integration
Version:6.x-1.0-beta8
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi

I enabled this module, add contentype for like button (blog, and some others), but nothing is shown for me on the nodes.
Doesn't matter if the like button is in the node or in the links.
Here would be like button, but it isn't: http://www.somvprahe.sk/blog/truli/pravda

Are there any other necessary steps? There are no permissions for this module, so I am really lost why it doesn't work at all for me.

thanks
Igor

Comments

#1

I found that problem is with IE 8. With Firefox it works nice.

#2

You (in fact module) should include this code in page.tpl.php to work with IE. Do not remove other xml related things in html tag if exist, just add this two xmlns defs then.

<html xmlns:og="http://opengraphprotocol.org/schema/"
      xmlns:fb="http://www.facebook.com/2008/fbml">

Hope this solves.

#3

+1

#4

@chawl thanks for the tip. The module actually cant easily add that information in the page.tpl.php

#5

Yes ferdi, sorry for the typo, I meant the documentation in fact. Tx for a great module btw.

#6

thanks chawl, now it works for me. But in IE 8 it is shown in the node before the content, and in the Firefox, it is show after the content. I suppose that in the Firefox it is right.
Any ideas why it is wrong in IE?
You can test it on the same url: http://www.somvprahe.sk/blog/truli/pravda

thanks
Igor

#7

By the way, I think IEs are right for the first time in the history #792192: Like button shows up in a different place in IEs than others

Even a broken clock shows the right time twice a day. I think this is a JS issue that FB should fix.

#8

Status:active» fixed

I hope this is fixed in the alpha4 release

#9

Is the documentation lacking or I am not doing something correctly? My "like" buttons do not show either in IE or Firefox. Here are the steps I took:

1. Installed and enabled the module(s).
2. Enter the application ID for my site, gotten from Facebook Developers site, Adjusted all the settings under "administer".
Still do not see any buttons on my site. I do see the fb:like tags in appropriate places though.
Where else should I look to troubleshoot?

The site is www.victortsaran.net.

Thanks,
Victor

#10

For me like button doesn't work at all :( Everything is enabled

#11

Tried to put this to contemplate:

<?php
print $node->content['fb_social_like_widget']['#value']
?>

But still doesn't work, nothing to display...

#12

Status:fixed» active

#13

I'm guessing (from #804994: Can I get user email and password when "map account" is enable?) that you have enabled some other drupal modules that are using the old version of fb api. See http://drupal.org/node/784872#comment-2909838

#14

If you are using drush to enable the module, you might want to look at the admin/build/modules page and you need to enable the other modules associated with the fb_social module. There are 3 other modules that needs to be enabled.

#15

Title:Like button doesn't show to me» Facebook 'Like' button doesn't show in Internet Explorer

Does not work on Internet Explorer. Sorry I created a duplicate issue because the title on this issue is vague. Changed title as well :)

#16

Status:active» closed (fixed)

Please see the FAQ section in the front page of this project

#17

Version:6.x-1.0-alpha3» 6.x-1.0-beta4
Status:closed (fixed)» active

sorry to re-open but there is still an issue with this solution.

YES - adding this to the top of page.tpl

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">

does allow the FB Like button to show in IE8 but it causes IE8 to popup a XSS warning.

#18

I don't get page errors.... or the LIKE button in IE8.

Everything is working in FF.

I tried the snipped versions in #2 and in #17 with no luck. I can understand how this might not be possible to address in the module itself, but if there is an undocumented fix it would be helpful to document it.

For purposes of testing, I am using 6.19 fb_social.info,v 1.3.2.1 2010/07/11

#19

my issue with FB Like and XSS was caused by incompatibility with with this module and the FB Connect module. This issue has since been fixed (not sure of commit status) with an update to the FB Connect module.

not sure if you are seeing the same issue.

#20

Not using FB Connect.

#21

Re #20 This may sound obvious, but apparently wasn't to me: check user permissions. I was reminded of this as I run Admin in FireFox so I can see what's going on and Authenticated_User in EE. Authenticated_User didn't have permission set to access the Like button.

#22

Fix #17 worked for me. Be sure you are adding it to your opening tag. I've just had some problems with getting this fix to work, but then I noticed I din't had have enough coffee, I'd added it to my DOCTYPE. Dow!

#23

When I use the

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">

I get som problems with my cse search function in IE8.
When I push the search button i get the search resultpage for about 1 second then I´m redirected towards a wsod page. Checked the errors and its the following (not an exact copy but my translation so there might be some differenses)

Message: 'undefined' is null or not an object
Row: 16
Character: 609
Code: 0
URI: http://connect.facebook.net/sv_SE/all.js
Message:
Undefined argument.
Row: 66
Character: 5
Code: 0
URI: http://mysite.com/sites/all/themes/my_theme/scripts.js?U

Anyone who knows what this is all about

#24

Status:active» closed (fixed)

Normally the like button shows on IE if the page template is modified similar to #2. Closing this ticket.

#25

Not showing for me either, but might be related to an undefined jQuery object caused by double loading all my js files via CTools AJAX. Arg!

#26

Status:closed (fixed)» active

Actually added the code to the html tags, but nothing works.
This is in html tag.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"
  <?php print $rdf_namespaces; ?> >

No permission problem, cause checking this under admin FF works, IE not.

#27

Comment #2 fixed it for me.
Using Fb Social 6.x-1.0-beta5

#28

Try this (get instead of print!):

<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo get_page_language($language); ?>" xml:lang="<?php echo get_page_language($language); ?>" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">

#29

I'm having a problem using this with an Artisteer generated theme. I'm not sure exactly what I should add and where. This:

xmlns:og="http://opengraphprotocol.org/schema/"
xmlns:fb="http://www.facebook.com/2008/fbml"

looks a lot different to this:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">

Here's the first 20 or so line of my code without adding anything.

<?php

    $vars
= get_defined_vars();
   
$view = get_artx_drupal_view();
   
$view->print_head($vars);

    if (isset(
$page))
        foreach (
array_keys($page) as $name)
                $
$name = & $page[$name];
   
$art_sidebar_left = isset($sidebar_left) && !empty($sidebar_left) ? $sidebar_left : NULL;
   
$art_sidebar_right = isset($sidebar_right) && !empty($sidebar_right) ? $sidebar_right : NULL;
    if (!isset(
$vnavigation_left)) $vnavigation_left = NULL;
    if (!isset(
$vnavigation_right)) $vnavigation_right = NULL;
   
$tabs = (isset($tabs) && !(empty($tabs))) ? '<ul class="arttabs_primary">'.render($tabs).'</ul>' : NULL;
   
$tabs2 = (isset($tabs2) && !(empty($tabs2))) ?'<ul class="arttabs_secondary">'.render($tabs2).'</ul>' : NULL;
?>


<div id="art-main">
<div class="art-sheet">
    <div class="art-sheet-body">
<div class="art-header">
    <div class="art-header-jpeg"></div>

</div>
<?php if (!empty($navigation) || !empty($extra1) || !empty($extra2)): ?>
<div class="art-nav">
    <div class="l"></div>
    <div class="r"></div>
    <?php if (!empty($navigation)) : ?>
    <?php echo render($navigation); ?>
    <?php endif; ?>
</div>

So, how should my page.tpl.php code look AFTER I add the Facebook Social code?

Thanks in advance for your help.

#30

Fixed it. It should look like this:

<?php
// $Id: page.tpl.php,v 1.18.2.1 2009/04/30 00:13:31 goba Exp $
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>"
xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml">


<?php


    $vars
= get_defined_vars();
   
$view = get_artx_drupal_view();
   
$view->print_head($vars);

    if (isset(
$page))
        foreach (
array_keys($page) as $name)
                $
$name = & $page[$name];
   
$art_sidebar_left = isset($sidebar_left) && !empty($sidebar_left) ? $sidebar_left : NULL;
   
$art_sidebar_right = isset($sidebar_right) && !empty($sidebar_right) ? $sidebar_right : NULL;
    if (!isset(
$vnavigation_left)) $vnavigation_left = NULL;
    if (!isset(
$vnavigation_right)) $vnavigation_right = NULL;
   
$tabs = (isset($tabs) && !(empty($tabs))) ? '<ul class="arttabs_primary">'.render($tabs).'</ul>' : NULL;
   
$tabs2 = (isset($tabs2) && !(empty($tabs2))) ?'<ul class="arttabs_secondary">'.render($tabs2).'</ul>' : NULL;
?>


<div id="art-main">
<div class="art-sheet">
    <div class="art-sheet-cc"></div>
    <div class="art-sheet-body">
<?php echo art_placeholders_output(render($top1), render($top2), render($top3)); ?>
<?php if (!empty($navigation) || !empty($extra1) || !empty($extra2)): ?>
<div class="art-nav">
    <div class="l"></div>
    <div class="r"></div>
<div class="art-nav-center">
    <?php if (!empty($navigation)) : ?>
    <?php echo render($navigation); ?>
    <?php endif; ?>
    </div>
</div>

#31

Not sure if this will help anyone but I was also having issues with this even after trying all the suggested fixes.

The way I got it to work was to remove all print_r() debug code I had. The moment I removed it, it worked perfectly fine without any errors - in all browsers! Must be something to do with the headers being altered before output or something along those lines...

Anyway, hopefully this helps someone else out!

#32

My like button and fb comments are not showing in ie7, It does work in ie8, FF and chrome

#33

What if the theme you're using doesn't have a page php file? How do you get the like buttons to show up with IE?

#34

I have tried the below with IE9 and nogo. I am using fb_social beta 8

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo $language->language; ?>" xml:lang="<?php echo $language->language; ?>">

Fixed.. had to turn off block caching.

#35

Version:6.x-1.0-beta4» 6.x-1.0-beta8

I have the same problem as #32: works fine in IE8, but doesn't show up in IE6 & IE7 (and in IE8 & IE9 compatibility modes)

#36

Works fine in FF, Chrome IE8 but not in IE6 & 7 and Safari

IE7 Reports the problem lies here in the last line of this code

<div id="fb-root"></div><script type="text/javascript">
     window.fbAsyncInit = function() {
       FB.init({
         appId: "00000000000000",
         status: true,
         cookie: true,
         xfbml: true,
         channelUrl: "http://bla-bla.com/fb_social/channel",
       });

It is having problem with either the } or the ) in that last line

#37

Same as #33 here. I have a Zen sub-theme that doesn`t have the page.tpl file.
Where should I add the code then?

#38

I was able to make this work in ie 6 & 7 by removing a comma in the fb_social.module file. I removed the comma after the channelUrl line ;

$output .= "
window.fbAsyncInit = function() {
FB.init({
appId: " . drupal_to_js($appid) . ",
status: true,
cookie: true,
xfbml: true,
channelUrl: " . drupal_to_js($channel_url) . "
});

Once I did this, the buttons began appearing in 6 and 7 (I.E 8 was never a problem). I'm using Adobe Browser Labs for testing, so I can't speak to the Java errors.

#39

As for the Zen Sub-theme, you just need to copy the page.tpl.php file from the Zen Templates folder into the root of your sub-theme.

Zen >> Templates >> page.tpl.php

You may have to clear caches to recognize the new file. Also, clear caches after making changes to the page.tpl.php as well.

#40

Status:active» needs review

Well spotted, harris_david. Looks like this has been committed to dev.

Can confirm the fix works.

#41

Status:needs review» fixed

Fixed in beta9

#42

Status:fixed» closed (fixed)

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

#43

#34 fixed for me.

nobody click here