Needs review
Project:
Social media
Version:
7.x-1.0-beta8
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 17:27 UTC
Updated:
12 Feb 2012 at 02:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
pverrier commentedI've updated the patch (was not taking the good url).
Comment #2
KoCo commentedsorry, wrong queue, ah now I'm following, which is also fine ;-).
And currently testing the patch too.
Comment #3
TomDude48 commentedThanks for the patch. This is a great addition, will be in my next push.
Comment #4
pverrier commentedThanks Tom ! :) Glad to contribute a little !
I propose some modifications, because I've problems when there are more than one widget loading the facebook library in the same page...
For now, the FB loading script (in socialmedia.widgets.inc L471 socialmedia_widgets_facebook_js_sdk()) is :
It's generated just before the tag producing the widget, each time.
I presume the first line
<script>if(window.FB){ window.FB = null ;}//eat this !</script>, which is not part of the facebook script, was to nullify and force the reloading of the FB library in the case of more than one widget generates its loading. That doesn't work for me (FF10 or Chrome17), and no widget is displayed.I propose the patch below (from the current dev version), which needs some explanations :
&appId=223324211035941, but I'm not sure it's correct. If I've well understood the appId is linked to the site, which must be registred on facebook, so I don't think it can be a constant like this... Please tell me if I'm wrong !<div id="fb-root"></div>each time a facebook widget is displayed, in my case two times because I use the like button I added, and the like box (in another set)... And the browser doesn't like having the same id twice... So I test the existence of this id to generate the div/id and the library import only once.I also added in the patch the corrections #1.
Comment #5
TomDude48 commentedIt seems to work well. I had to make one adjustment to how the country was handled for sites where the county had not been set. Other that that your patch worked.
Comment #5.0
TomDude48 commentedtext correction