The bug i discovered was that the mobile version would always be turned on in my installation. I think this is related to PHP 5.3, which I am using. I think that because in $browser array any string will be understood as true, even if the content of the string says false. what i did was change line 10 to:

     if ($browser['ismobiledevice'] == "true") {

works for me :D

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jjwhitney’s picture

Thank you. This helped.

Simon Georges’s picture

Status: Active » Needs review
FileSize
1.08 KB

I'm providing a patch implementing the help from @Eikaa (and adding a "Implementation of hook_init()." comment, while I was at it).
It works for me. All credits and thanks to @Eikaa for the help !

rsevero’s picture

The problem seems to be that values returned as boolean from Browscap with PHP < 5.3 are currently returned as strings with PHP >= 5.3.

The patch available at #664424-22: Values returned as bool with PHP < 5.3 should also be bool with PHP >= 5.3 fixes this. If this patch is applied to Browscap, Mobile Theme should not have any change at all rendering the patch available at the previous comment unnecessary.

rsevero’s picture

To confirm that the above solution actually works you have to:

  1. fetch the lastest Browscap dev version;
  2. apply the patch available at #664424-22: Values returned as bool with PHP < 5.3 should also be bool with PHP >= 5.3 to it;
  3. DON'T apply the patch available at #2 above;
  4. make Browscap re-fetch it's configuration data. It doesn't matter if Browscap says it already has up to date info. You have to delete current Browscap configuration info and make Browscap re-fetch it;
  5. test Mobile Theme.

To force Browscap to re-fetch it's configuration info you can:

  1. delete the following variables from the "variable" Drupal table: browscap_imported and browscap_version. I used phpMyAdmin to do this;
  2. flush all Drupal caches. You can do it with the "Clean caches" option at the bottom of http://example.com/admin/settings/performance. Flushing only the variables cache is probably sufficient by I don't know how to do it through the user interface.
  3. asking Browscap to re-fetch it's configuration info through the "Refresh now" option available at http://example.com/admin/settings/browscap.
peterconnolly’s picture

Please note that this patch hasn't been rolled into the latest release, 6.x-1.x-dev, 2011-Feb-25.

Eikaa's solution above still works, but has to be put in manually on line 9 of mobile_theme.module (the patch didn't work for me)

Torenn’s picture

Maybe it's just "ill-fortune" but I seem to be unsuccessful with all the methods above.

I attempted every described fix but either it works very inconsistenly, breaking if I try to log with an user with admin privileges on a mobile device, or doesn't work at all.

It's also very hard to troubleshoot what's going wrong without any *error*. I hope both browscap and mobile_theme will have a bit "shiner" support of PHP 5.3 on D6. In the mean time I'm forced to disable them.

Devin Carlson’s picture

Status: Needs review » Closed (fixed)

The issue with Browscap has been fixed.