Wednesday, October 2, 2013

Drupal Module: browscap - Current browscap data version: Never fetched



I installed a Drupal module called browscap to detect mobile devices. Both the dev version and the stable version did not work on my Drupal 7 installation. Browscap provides an improved version of PHP's get_browser() function. Browscap stores browser data in a database and automatically retrieving the latest data on a configurable schedule. It uses this data to help detect mobile devices such as smart phones and tablets.

When I went to administration | system | browscap, I saw the following problem.

After searching for a while found a solution that fixed my problem.

Current browscap data version: Never fetched

You need to SSH into your server and modify the import.inc file. This is usually located at sites/all/modules/browscap. Locate the file and open it with a text editor such as vi or emacs. Locate the following line. Mine was around line 50.

$browscap_data = drupal_http_request('http://tempdownloads.browserscap.com/stream.php?BrowsCapINI');

And change it too the following line.

$browscap_data = drupal_http_request('http://tempdownloads.browserscap.com/stream.php?PHP_BrowsCapINI');

I uninstalled the module by first disabling it, then uninstall using the Drupal admin interface. After that I enabled it and the "Never fetched" message turned into a version number. There on out the browscap module began working and correctly detected mobile devices.

1 comment:

  1. Mobile platform is exploding with a plethora of handheld and tablet devices. This is where Drupal kicks in and pushing for the go to platform. Drupal has a lot of things that makes it very easy to use on mobile applications. drupal mobile version

    ReplyDelete