Hi--I installed & setup Drupal for Facebook and all seems to work well (Have a registered app, Facebook connect shows up and works, etc.) Except that I have two websites with different domain names running from the same content using Domain Access. And when I enable my FB app all visits to the second domain suddenly get the main theme from the primary domain. As soon as I disable my FB app things go back to normal and each site gets its own theme, as configured in the Domain Access module's settings.

I've read through all the issues I could find on support for multiple domains and understand there are issues with anything fancy like multi-domain login, but I'm not looking for that, just trying to figure out why the wrong theme suddenly starts getting loaded. Not sure if this is a bug report or feature request but I'd love to hear there is some simple fix or workaround. Thanks!--David

Comments

Dave Cohen’s picture

Weird. fb_canvas.module and fb_tab.module are both capable of changing the custom theme, but should only do so on a canvas or tab page. Try disabling just those and see if you can determine which is causing the problem.

Do you have the fb_devel.module enabled? It offers a block which will tell you what modules/fb thinks the page is (i.e. canvas, tab, or something else)

digitalpro’s picture

Dave--I've disabled the fb_canvas and fb_tab modules but it doesn't change anything. I do have fb_devel installed and have looked at the output (for my page which is a fairly generic view) and don't see anything in the output that shows any code over-riding the theme. What is odd is that it shows that the "site default theme" for this site is now the same as the site default theme for the main site (Acquia Slate New in this case). The minute I disable my Facebook App the default theme instantly goes back to what it should be (Endless News). So maybe something in the FB module is causing a problem where the domain module doesn't get called to over-ride the default theme with the default theme for the second domain?

The only other (unavoidable?) thing I've noticed is that the FB module complains that the FB App is suspicious since it is set up for the primary domain (cardinalphoto.com) but is getting invoked on the second domain (nikondigital.org). Unless there is some way to only make the app active for a single domain I'm not sure how to avoid that since whichever one it uses for its URLs the other one will show as suspicious?

Thanks for any thoughts. I've pasted the initial Devel module output below. I can paste other parts if they'd be helpful but am not savvy enough to know which if any might cause security issues so I didn't want to post it all willy-nilly. --David

Page Status = Facebook SDK initialized. User is not logged into facebook or has not authorized application.
fb_facebook_user =
login button = Connect
login link = fb login
local user = David Cardinal
fb_get_fbu =
base_url = http://www.nikondigital.org/content
base_path = /content/
url() returns = /content/
$_REQUEST[q] is = user/5/edit
arg(0) is = user
arg(1) is = 5
session_id = runfud91c3851u08jkapfso291
session_name = SESSaa11cceac5a185eced53addcb1b12068
fbsettings(FB_SETTINGS_COOKIE_DOMAIN

Dave Cohen’s picture

You mean you disable the application, rather than disabling the module(s), and that alone solves the theme problem? Very strange, as I don't know what could be tweaking the theme.

The warning comes from the fb_devel.module, should be only visible to admins and can be ignored until you disable fb_devel, which should be disabled on live sites.

The Page Status output tells me it knows the page is neither a canvas page nor a tab. I don't know what code would be affecting the theme. If you can track it down, great. Otherwise I'm out of ideas.

Dave Cohen’s picture

Actually I have one idea....

Modules tweak the theme by setting a global called $custom_theme. But if anything calls theme() before $custom_theme is set, the default theme will be used. So it may be that the warning from fb_devel is causing the problem. Try disabling fb_devel. Or, if there is any other warning, from any module, it could do the same thing. Look in drupal log for anything being written there.

digitalpro’s picture

Dave--Great suggestion. Disabling the devel module indeed let the themes show up correctly. The only glitch seems to be that now the Facebook Connect & Facebook Login buttons no longer do anything on the primary domain (where the FB App URLs point) but ironically they actually do work on the secondary domain (the less important one). Not sure what is up with that or why it would work that way so that is the next thing I need to try to sort out [The Connect & Login boxes show up as links but clicking them appears to do nothing]

FWIW the FB Login HTML is:

Choice of browser doesn't seem to matter.

--David

Dave Cohen’s picture

Sounds like an error in javascript you may be able to track down with firebug.

digitalpro’s picture

Dave--Actually a "fresh" start by flushing all the caches, restarting browsers, etc. seemed to clear the problem and things are working quite well. This is definitely pretty cool stuff. I've more or less got two apps set up (one for each domain) with FB Login/Connect/Like mostly working. Thanks for the help!.

digitalpro’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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