Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#2 | mobile_theme_854538_2_true_test.patch | 1.08 KB | Simon Georges |
Comments
Comment #1
jjwhitney CreditAttribution: jjwhitney commentedThank you. This helped.
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedI'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 !
Comment #3
rsevero CreditAttribution: rsevero commentedThe 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.
Comment #4
rsevero CreditAttribution: rsevero commentedTo confirm that the above solution actually works you have to:
To force Browscap to re-fetch it's configuration info you can:
Comment #5
peterconnolly CreditAttribution: peterconnolly commentedPlease 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)
Comment #6
Torenn CreditAttribution: Torenn commentedMaybe 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.
Comment #7
Devin Carlson CreditAttribution: Devin Carlson commentedThe issue with Browscap has been fixed.