Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Facebook like box and Twitter profile widgets not showing on either the setup wizard or on blocks
Comment | File | Size | Author |
---|---|---|---|
#17 | socialmedia.widgets.inc_.txt | 51.91 KB | fenstrat |
#12 | 1509622-12-facebook_localization.patch | 2.21 KB | fenstrat |
#2 | 4-9-2012 6-48-39 PM.png | 25.73 KB | sashkernel |
Comments
Comment #1
TomDude48 CreditAttribution: TomDude48 commentedCan you send me a link to the site?
Comment #2
sashkernel CreditAttribution: sashkernel commentedI'm having problem with facebook like box. Only have a "preview" word displayed. That's all :(
See screenshot attached.
Comment #3
sashkernel CreditAttribution: sashkernel commentedJust tried manually create a widget, but it does not display like box either :(. Is there some tutorial for dummies on how to configure it?
Regards,
Sash
Comment #4
TomDude48 CreditAttribution: TomDude48 commentedTry refreshing. Some widgets are a little finicky and don't always display.
I can reproduce the issue on my side.
Comment #5
sashkernel CreditAttribution: sashkernel commentedNope. Did not do it. I even flushed all caches.
Comment #6
TomDude48 CreditAttribution: TomDude48 commentedCheck your browsers JavaScript console. Do you see a JavaScript error?
Comment #7
jimbo_cambridge CreditAttribution: jimbo_cambridge commentedsub. I have the same issue, buttons work fine, facebook like box and twitter feed do not work. Previous twitter feed and facebook social blocks worked fine with other modules. 1 javascript error I can see on my machine is
Timestamp: 11/04/12 5:29:33 PM
Error: y.decay is not a function
Source File: http://widgets.twimg.com/j/2/widget.js
Line: 12
don't know if this is related, but only error I could find!
My site is on local server so cannot show you, but the block is created (css effects are rendered and firebug shows widget html) but there is no content displayed
Hope this helps.
Jimbo
Comment #8
sashkernel CreditAttribution: sashkernel commentedMy site is live and I have latest java installed.
www.scallagrims.com
Like Box is right under "Like" button on the right hand panel. It is in the code but no results.
Comment #9
Dadaisme CreditAttribution: Dadaisme commentedHi!
Same here.
The Facebook like box do not appear in the widgets settings page, but is present in the blocks page. When the block is enable, I see the code in the page but nothing is rendered. I'm using the latest beta.
Error : Failed to load resource: the server responded with a status of 403 (Forbidden) http://connect.facebook.net/fr_US/all.js
Thx.
Comment #10
drupalnode CreditAttribution: drupalnode commentedI am having a similar issue on my local development. I looked into the Facebook Development area (https://developers.facebook.com/docs/reference/plugins/like-box/) they are using the following connection string
(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/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));When the Drupal connection string is
js.src = "//connect.facebook.net/'.$loc.'/all.js#xfbml=1";
So I changed my socialmedia.widgets.inc connection string to the Facebook and now it is showing up in my configure options like (http://drupal.org/node/1378042) but when I place the block into a region there is no 'like box' there. It is also not showing up in the source for the region.
Any suggestions?
Comment #11
MacMladen CreditAttribution: MacMladen commentedI think I figured the problem and that is localization.
The author wanted to give options on languages but it is not the way it seems so, so it is flaw by design.
When I checked request I got en_RS which would mean 'English language in Serbia' which does not exist but reality is that we need English for other visitors so when we call for English that is for any user that picks US flag for English
en_US
and Serbiansr_RS
for Serbian flag (orfr_FR
for French for @Dadaisme) and not origin country and selected language.So, maintainer have to either follow language and match country to have right
all.js
pulled or to stick with country and therefore with language too which would be wrong because English would not understand Facebook in Serbian.The function in question is in
socialmedia.widgets.inc
and it isfunction socialmedia_widgets_facebook_js_sdk() {
starting on line 507 with variable$loc
that should be formed with different country reading.Comment #12
fenstratThe problem is indeed localization.
Borrowing the approach fb_social module uses the attached patch checks the locale (based on site language and country, e.g. en_US) is valid with facebook's locales before using it and defaults to en_US if it is not valid.
Without this addition the module can use invalid locales (e.g. en_AU or en_RS) which causes facebook to return
403 (Forbidden) /* Not a valid locale. */
. At which point fb's all.js is not included and the like box does not render.Also, this module needs some serious TLC in regards to coding standards, but that's for another issue.
Comment #13
fenstrat@drupalnode contacted me via email, much better to discuss here:
To make sure the patch is working use firebug to monitor net requests, is the request going to http://connect.facebook.net/en_US/all.js#xfbml=1 or en_AU or some other local which is not valid?
Also make sure the facebook url you're requesting is valid.
Comment #14
askibinski CreditAttribution: askibinski commentedAfter applying the patch in #12 the 403 js error is gone, but it is replaced by another one:
The box now renders with an error saying "There was an error fetching the like box for the specified page."
Comment #15
fenstrat@askibinski Are you getting that error using https? Also it looks like your getting that error when rendered in the admin overlay, what happens when rendered in the front end theme?
Comment #16
Adel CreditAttribution: Adel commentedSame problem here, patch on 12 return a php error, I tried twice but just in case, could you share the patched file please ?
Comment #17
fenstrat@Adel I've attached socialmedia.widgets.inc with the patch in #12 applied. However you should really be able to patch the file yourself, please see http://drupal.org/patch/apply
As there's been no reply from @askibinski I'm setting this back to needs review.
Comment #18
TomDude48 CreditAttribution: TomDude48 commentedI applied fenstrat's patch. It is working for en_US, please test other locales.
Thanks for the patch fenstrat!
Comment #19
fenstratNo worries @TomDude48 - I can verify it's working for en_AU which properly defaults back to en_US as en_AU is invalid. Anything else needed to get this committed?
Comment #20
fenstratIt appears #12 was committed in e72ef53.
Comment #21
TomDude48 CreditAttribution: TomDude48 commentedComment #22
Adel CreditAttribution: Adel commentedPatch worked, I had the same problem because of my javascript version: I am using a 64 bit windows and had Java for 32 bit, so when I checked for updates online, my Java machine was update but the trick is I should uninstall it and install the 64 bit version, now everything is fine.
Comment #23
fenstrat@Adel The patch here in #17 is part of socialmedia 7.x-1.0-beta12. So there's no need to apply it, just use the latest version of the module.