Drupal Association members fund grants that make connections all over the world.
Enabling caching when using the 6.x-2.7 version causes an error to be generated. When requested by a mobile device, the server throws a 500 error and logs the following message:
Call to undefined function _mobile_tools_is_mobile_device()
The issue occurs because the missing function has been refactored in the 2.5 branch in the main code, but the module cache has not been updated.
Using two a separate mobile and desktop theme, and switching based on device. Enable a mobile detection method (I'm using Browscap, which also has issues, see this issue: http://drupal.org/node/1835750).
Upgrade module from 2.3 to 2.7 as normal
Ensure that caching has been enabled in the settings,php file, in accordance with the instructions in mobile_tools_cache.inc:
$conf['page_cache_fastpath'] = FALSE;
$conf['cache_inc'] = './sites/all/modules/mobile_tools/mobile_tools_cache.inc';
On the performance administration pages, enable caching, setting it to normal.
Put the site online again, switching maintenance mode off.
Any page using the desktop theme displays fine. Any theme using the mobile theme generates a server 500 error and the message
PHP Fatal error: Call to undefined function _mobile_tools_is_mobile_device() in /var/www/html/[site name]/sites/all/modules/mobile_tools/mobile_tools_cache.inc on line 207
The line is in the following function:
require_once(dirname(__FILE__) . '/mobile_tools.module');
$result = _mobile_tools_is_mobile_device();
$query = $_GET;
$seperator = count($query) ? '&' : '?';
$cid = $cid . $seperator . 'mobile_group=' . $result['group'] . '&device=' . $result['type'];
The problem is that the _mobile_tools_is_mobile_device() has been removed during refactoring for 2.5. In the main code, the function has been replaced with a call to a variable:
$browser = module_invoke($device_detection, 'is_mobile_device')
The intent of the original _mobile_tools_is_mobile_device() function is to avoid reliance on external browser detection modules.
The best solution is probably to invoke the new function, which has been moved into the modules/mobile_tools_detection/mobile_tools_detection.module file.
require_once(dirname(__FILE__) . '/modules/mobile_tools_detection/mobile_tools_detection.module');
$result = mobile_tools_detection_detect_mobile_device();
This removes the error, but it does not look like it is caching the site correctly. I am still seeing the desktop site on my mobile device, despite having configured it all correctly.