This is a rather aggravating bug that I can't quite solve myself. I have mobile_tools running on a site which has a theme which was originally built by another studio... and also a zen-based mobile theme I created, having removed all the fixed widths in my layout and other files.
For a couple months everything was working well. At some point (perhaps after an upgrade of the site modules or the iPhone(?)) the mobile switcher stopped working. After some investigation I found that browscap was missing, so I added it and I cleared the caches. I saw one of my users had enabled redirection even though we used one domain, so I set that back to disabled and everything related to the switching was good... everything except iPhone.
When I view the page on iPhone it assumes the page is 800-960px wide when it should be only 320px wide. The result is that everything gets zoomed *way* out so that you cannot read the buttons.
I can't find any reason for this. There is no code in the CSS that sets a fixed width in my code. When I limit the width to 320px it still renders ~800-960px wide leaving a bunch of white space.
I checked this on my dev site and everything is fine.
I copied the dev theme code to live, flushed all caches. Dev site is fine, live site is not.
I reviewed all of the settings for the module in the UI and in the variables table = all the same values.
I truncated various cache_* tables. Flushed all the caches.
I added the secret code to the settings.php file. Flushed caches.
I ran the tests on both the root domain and the domain with the www. prefix after cleaning out my cookies on the iPhone. I did it after clearing the cache on the iPhone, and the history on the iPhone.
So where do I turn to next?
From what I understand about iPhone coding is that the viewport is probably being set incorrectly somewhere but I haven't found any setting for it and no reason why it would have suddenly changed.
Comments
Comment #1
Anonymous (not verified) commented*Nodewords* is the cause! I have not figured out why yet, but it seems to be independent of what data is stored in the Nodewords module. I can replicate on different sites.
Nodewords has no CSS and no span tags (apart from a couple colspan array keys).
Comment #2
Avasyu commentedInteresting, I had the exact same problem and disabling nodewords fixed the problem. Of course, I need nodewords....
Comment #3
Anonymous (not verified) commentedI think it works ok if you run mobile_tools after you run nodewords. In my case, nodewords had a weight of 10 and nodewords_basic had a weight of 12. So I set mobile_tools to 15.
To set that up, configure it in MySQL:
mysql>
update system set weight=15 where name = 'mobile_tools';Comment #4
kthullHoly crap I was going nuts until I found this post. I recommend you change the title to "Nodewords breaks mobile switching" because it's not just tiny text, it was preventing the mobile version from showing. Burned yet again by Nodewords. Grrrr.
Comment #5
Anonymous (not verified) commented@kthull I agree, the name should be changed now that we know what is causing it. I created the original post but I can't update the title. Seems we need the MT devs to do that.
Comment #6
Anonymous (not verified) commentedOh, turns out the title field can be changed each time you comment on ddo. Awesome!
It would also be handy if there was a mention in the README and/or project page. Something along the lines of: "You may need to adjust the module weight to be sure that mobile tools runs after all of your other modules have run." Even better if it had some sample code from #3.
Comment #7
devin carlson commentedThis is now fixed by #1622970: Assign Mobile Tools a heavy module weight so that it runs after other modules.