Closed (outdated)
Project:
Mobile Tools
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2012 at 18:57 UTC
Updated:
26 Jun 2020 at 14:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dallasw1983 commentedI had the same problem with version 6.x-2.7, I'm not sure whats causing it because I can comment out line 20 and run browscap_get_browser() and it returns an array.
So for a work around I did...
Comment out line 20
#$user_agent = browscap_get_browser();Add the function from the module browscap/browscap.module (version 6.x-2.0) line 76 to line 126 and rename the function to
tmp_browscap_get_browser().Then add below the new function
$user_agent = tmp_browscap_get_browser();I'm not 100% sure on how this overall affects the site, but it got my mobile site back up and running with no global fatal errors and figure it's safe since it's using the same code as the browscap module.
I've also attached mt_browscap.module which is named mt_browscap.txt for upload purposes.
Hope this helps!
Comment #2
alfthecat commented@dallasw1983,
Thanks for this, I had the same issue using 2.x-dev of mobile tools and the 2.0 version (D6) of browscap. Your updated module file fixed my issue too.
Comment #3
greggmarshallWhile the fix appears to resolve the issue, it bothers me that the code needs to be duplicated. I thought it might be a module weight issue, so I tried setting browscap's weight to -5, in theory that should load it before mobile tools (default weight of 50) and mt_browscap (default weight of 0), which did not resolve the problem.
Comment #4
kropotkinthinks commentedLike Alf, I had the same issue. I had it with both the mobile_tools 2.3 and the 2.7 module. The Browscap 1.5 version worked fine, but upgrading to 2.x kills the site.
However, the issue only seems to appear when caching is enable. Disable caching and everything works fine. Enable caching and the site dies, with the undefined function message. Clearing the cache does not appear to help the situation either.
So the issue appears to reside in the way the functions are cached. But I haven't figured out exactly how yet.
Thanks for the fix, that is a big help.
Comment #5
hwasem commentedThank you for this fix.
Comment #6
Anonymous (not verified) commentedHi Guys, I solved problem adding following line to mt_browscap.module file:
Same problem happend to mobile_switch module has been solved adding code portion to mobile_switch.module
Comment #7
edonnelly commented#6 solved the issue for me, and I really appreciate it because the site was just error-ing out on every page, including all admin pages.
Comment #8
greggmarshallI wonder if a better solution to #6 might be
drupal_load('module', browscap);Comment #9
wmad commentedYes, #8 worked for me. I agree that it is a better solution.
Comment #10
edonnelly commentedI updated my module to 6.x-2.7+3-dev (2013-Feb-22) today, got the same error again, and #8 worked for me. Thanks again!
Comment #11
possibriAlso came across same issue and #8 worked like a charm! Thanks guys =]]
Comment #12
miklI've created a patch including the solution from #8, as well as a fix for erraneous mobile detection when used with Browscap 2.x.
Comment #13
Anonymous (not verified) commentedMarking this as "critical" since "Critical bugs either render a system unusable". I think WSOD and no update.php access qualifies.
The patch in #12 is appropriate and works well. I had tried adjusting the weight of the module to no effect. Thanks for the patch! Much appreciated.
Comment #14
nateman332 commented#8 worked for me. I'll change this to "reviewed an tested by the community" since it seems that it's worked for people. (change it back if I'm wrong) :)
Comment #15
EvanDonovan commentedI can confirm that the patch in #12 works.
Comment #16
alexmoreno commented#8 tested here too. It works like a charm.
Comment #17
iaha commentedPatch in #12 works for me.
Comment #18
pribeh commentedRunning browscap with mobile tools took down my site. Patch in #12 resolved the issue quite nicely. Danke!
Comment #19
chinita7 commentedI had the same issue. #12 works for me. Thank you!
Comment #20
avpadernoI am closing this issue, as it's for a Drupal version no longer supported.