The mobile theme seems to switch fine for front page, and other paths which are not related to nodes.

When visiting the node/[nid]/view page, with path alias installed, the theme displayed is the default theme.

The global $custom_theme is set to the mobile theme, and inside of my default template.php, in the preprocess_page, if I load $custom_theme, and do a dsm() on it, it shows the mobile theme name, but it is not being loaded.

I have display suites installed on this site, but I tried uninstalling it completely, after taking a backup and clearing all cache, with no difference.

I had it detect the mobile theme based on the m.domain.com practice to force the mobile theme.

Comments

xrampage16’s picture

Just performed a check where I changed the default theme of the site to the mobile theme to make sure and verify that the mobile theme was able to load the mobile display. As expected, the mobile theme rendition of the site loaded just fine.

Also, adding init_theme(); after setting the custom theme

global $custom_theme;
$custom_theme = $theme;

made no difference.

Another thing to make note of, is that the mobile theme has a different "block" sections. I am not sure if this is relative to the issue, but am trying it out on a test server to see if that helps.

Also, when running debug_backtrace from inside of the default theme on preprocess_page, the default theme is getting called from theme.inc.

After further inspection, when running a debug on init_theme() from theme.inc, it looks that global $custom_theme is being loaded, but is not being recognized.

The results of debug_backtrace from inside of init_theme() in theme.inc show that nothing has been called inside of mobile_theme(), so it is being bypassed directly.

xrampage16’s picture

After walking through a working rendition of a page that had mobile theme working, and another that did not which should, I found that the short url module was hijacking the init method from module_invoke_all, and was stopping all other init() from being called.

After disabling the module, the node pages started displaying correcty