I would expect that if visiting a desktop version of my site using a mobile device but with nomobile set to false, I should be redirected to the mobile version of the site.
And if I visit the mobile version with nomobile set to true, I should be redirected to the desktop version of the site.
The second way roung is working at the moment, but the first is not. I then note that in mobile_tools.module on line 378 and 382, the variable $redirect is assigned the strings 'TRUE' and 'FALSE' (in capitals), according to the state of 'nomobile'. But on line 397 we check for $redirect to contain the value 'true' (lowercase) and don't attempt any kind of redirection if it is not 'true'.
Firstly, there ought to be redirection happening in certain circumstances where nomobile=false, so I think the check in line 378 is wrong.
Secondly, why are you using strings to hold true/false values? They can result in unexpected behaviour - for example they are case sensitive. I tried switching the 'true' in line 378 to uppercase so that it matched - but this made everything worse.
Should I try to re-code this part of your module for you (I am offering to do this if you agree with my analysis), or have I completely misunderstood somehow?
Comments
Comment #1
twom commentedHi,
Sorry to get back this late to your helpfull response. I would be verry happy if you could help me out and recode this piece of the code (that is clearly not-optimal)!
Let me know if you are still interested in doing this work. Otherwise I will take a closer look next week.
Regards,
Tom
Comment #2
martin_qHi Tom,
only just seen this, but yes, I or my colleagues will be happy to take this on. I'll get back to you with a proposed patch after we've had a look at it.
Thanks,
Martin
Comment #3
twom commentedThis code has been rewritten... The above mentioned problems should be fixed.
See the mobile tools documentation page for more details.