After enabled fb module I get this javascript error
Uncaught TypeError: Cannot read property 'js_sdk_url' of undefined
Drupal.behaviors.fb on fb.js:238
It breaks Linkit Ckeditor module.
Here pasted, the Chrome Inspector error, maybe it helps:
Uncaught TypeError: Cannot read property 'js_sdk_url' of undefined
Drupal.behaviors.fb fb.js:238
(anonymous function)drupal.js:41
D.extend.each:1
Drupal.attachBehaviorsdrupal.js:40
Drupal.theme.placeholderdrupal.js:271
D.fn.extend.ready:1
D.extend.ready.D.readyList:1
D.extend.each:1
D.extend.ready:1
CKEDITOR.plugins.add.init.editor.addCommand.exec/sites/all/modules/linkit/editors/ckeditor/plugin.js?t=A8LE4JO:23
a.command.exec/sites/all/libraries/ckeditor/ckeditor.js?B:20
e.extend.execCommand/sites/all/libraries/ckeditor/ckeditor.js?B:25
k.button.e.extend.click/sites/all/libraries/ckeditor/ckeditor.js?B:42
k.button.render.t.execute/sites/all/libraries/ckeditor/ckeditor.js?B:42
a.tools.addFunction/sites/all/libraries/ckeditor/ckeditor.js?B:10
a.tools.callFunction/sites/all/libraries/ckeditor/ckeditor.js?B:10
(anonymous function):2
onclick
Comments
Comment #1
Dave Cohen commentedtry refreshing drupal's caches. If that doesn't fix it, add a watchdog call to fb_preprocess_page(), just to see if it is being called. I suspect it is not, but I can't say why not.
Comment #2
Anonymous (not verified) commentedThanks for your answer. I remove the fb folder and download everything again and cleared the cache, but the error still there:
fb:238 Uncaught TypeError: Cannot read property 'js_sdk_url' of undefined.Also there is another error message, I don't know if it's related:
FB.getLoginStatus() called before calling FB.init() at all.js:9Regards
Comment #3
Dave Cohen commentedSome other module is initializing the older facebook javascript, or initializing without an apikey.
Disable any other module which integrates with facebook as described on http://drupal.org/node/933994
Comment #4
Anonymous (not verified) commentedHi Dave,
I'm sorry for give you the run-around with the errors, after reset the cache and disabled Facebook social module the last error disappears, but the first ('js_sdk_url') still there.
Thank you
Comment #5
Dave Cohen commentedDid you understand comment #1 where I suggested the watchdog message? Can you add that to determine whether fb_preprocess_page is being called at all?
Are you using an unusual theme? Can you try to reproduce in garland or marina theme?
Comment #6
Anonymous (not verified) commentedYes, I added a watchdog call, and fb_preprocess_page() is been called. I change the theme and the admin theme to Garland and the same error again. :(
Comment #7
Dave Cohen commentedNow its officially mysterious.
Do you have the know-how to step through javascript in say FireBug? I'd like know what Drupal.settings, and specifically Drupal.settings.fb is when that error happens.
Or view the source of the page and look for where Drupal.settings is set.
I'm assuming this is a problem on your end because no one else has reported it. But I'd like to understand what's going on.
Comment #8
Anonymous (not verified) commentedCan I send you the url by contact form?
Comment #9
maddentim commentedI am having this issue as well in connection with the imce module. It makes a popup for rich text editors like tinymce. If I disable fb, then all works fine. When fb is enabled, the popup does not load all the elements needed. In firebug console, it shows an error with Drupal.settings.
In my testing I see that fb_init getting called when the pop loads, but fb_preprocess_page is not. As a workaround, I tried adding a module_invoke in imce for fb_preprocess_page, but got errors from it. "Missing argument 1 for fb_preprocess_page() in /.../sites/all/modules/fb/fb.module on line 231.". It's just not the way to call a preprocess i gather.
I need to figure this out as it has broken IMCE and it is how I add images for page content... I could move away from imce, but i would have to retrain the users... argh...
What controls when a module calls a preprocessor?
Comment #10
dtecson commentedI did a bad thing to fix this, but it works for now. The issue is happening here
if (typeof(FB) == 'undefined') {
// Include facebook's javascript. @TODO - determine locale dynamically.
//jQuery.getScript(Drupal.settings.fb.js_sdk_url);
jQuery.getScript('http://connect.facebook.net/en_US/all.js');
}
So just I connected directly to the needed js file for now.
Comment #11
maddentim commentedHi, In the end, I hacked fb so that it ignored IMCE pages. Not the ideal workaround, but it duct taped this particular issue until a better solution is devised.
Comment #12
mpdonadioThis is also happening with the LinkIt w/ TinyMCE. The Normal link, image, and HTML popups work fine, but they are self contained in TinyMCE and don't go through the bootstrap.
The LinkIt popup does go through the full bootstrap process. In this case, "fb_connect" is getting added to Drupal.settings, but "fb" isn't. Rootcandy is the admin theme, and edits use the admin theme.
fb, fb_app, fb_connect, fb_user, and fb_views are enabled.
EDIT: As far as I can tell fb_preprocess_page() is not being called. If it matters, the LinkIt page is wiredup with a hook_menu, but I don't know how TinyMCE launches this as a popup.
EDIT 2: If I browse directly to the URL that the hook_menu defines, fb_preprocess_page() doesn't get called either. The callback attached to the menu item just does a
so I suspect that is why fb_preprocess_page() never gets called.
EDIT 3: Tentative fix, but it just supressess the JS error and allows this particular popup to work.
Comment #13
Dave Cohen commentedPlease try this fix: http://drupal.org/node/981304#comment-3799042
Comment #14
mpdonadioThanks, I didn't run across that thread when searching for this problem. The patch worked for the LinkIt problem I described.
Comment #15
Dave Cohen commentedI've checked in that patch, so assuming this is fixed in latest dev. Please re-open if that is not the case.