Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
My FB like box was not showing and i noticed a forbidden js in my code...
It was the connect.facebook.net/pt_br_BR/all.js
In the facebook api documentation there is an example " connect.facebook.net/es_LA/all.js " ( its clearly different from the js our module is looking for wich is language+country)
So i just fixed the sites/all/modules/socialmedia/socialmedia.widgets.inc
Starts in line 472 ends in 494
FIXED FUNCTION:
// PVE 8-10/2/12 translation management + produce FB library only one time
function socialmedia_widgets_facebook_js_sdk() {
global $language;
$country = variable_get('site_default_country', 'US');
if (!$country) {
$country = 'US';
}
$loc = explode("_", $language->language);
$facebook_js_sdk = '<script>
if (!document.getElementById("fb-root")) {
fb_root = document.createElement("div");
fb_root.id = "fb-root";
document.body.insertBefore(fb_root,document.body.firstChild);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/'.$loc[0].strtoupper($loc[1]).'/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
}</script>';
return $facebook_js_sdk;
}
I do lack the PHP skillz but i hope it helps you guys!
Comments
Comment #1
TomDude48 CreditAttribution: TomDude48 commentedThis is a duplicate issue of http://drupal.org/node/1509622 so I am closing. I put a fix in the latest push, please verify it works.
Comment #1.0
TomDude48 CreditAttribution: TomDude48 commentedblabla