I'm using Drupal 7.17 and mobile switch. Today I get a new update notice from mobile switch and I decided to update it. After that I get following error message for homepage of my website:

Fatal error: Call to undefined function browscap_get_browser() in ..../sites/all/modules/mobile_switch/mobile_switch.module on line 216

Hopefully I can access to admin interface and disabled mobile switch module so my site is available again.

Comments

coolman7’s picture

Component: Miscellaneous » Code
aaronstpierre’s picture

I'm also getting the same error. Gonna dig a bit deeper now.

Coolman7: To get your site functional:

Quick way
simply move mobile_switch directory out of your modules directory. That will get the site functional again.

Proper way
Go to the database and find the system table. Once there search for the mobile_switch module and set

status and bootstrap to 0

That will disable the module.

quiptime’s picture

The problem is the Browscap module.

In previous versions of the Browscap module (branch 1) this module are an bootstrap module - but currently (branch 2) not.

You can check this: Take a look at the system table an see the browscap module entry. The row bootstrap is 0.

Quick fix for a solution

Insert this code in the file browscap.module

// Include browscap data import and user agent recording functions
include_once('import.inc');

/**
 * Implements hook_boot().
 */
function browscap_boot() {
  // No functionalities here.
  // We use this hook to set autmatically the system table bootstrap value
  // for this module to 1.
}

 

If you inserted the code

  1. deactivate (not uninstall) the Mobile Switch and the Browscap module
  2. activate the Browscap and the Mobile Switch module

And now, Mobile Switch works.

You can recheck the system table to see the browscap module entry. The row bootstrap is 1.

Finally,
I reported this problem the Browscap module.
Browscap no longer a bootstrap module

crutch’s picture

Yes, this worked thank you. Re: http://drupal.org/node/1831658#comment-6740944

Just noticed the module is fixed now with Browscap 2.0 11/22/12

quiptime’s picture

The final solution to fix the error coming soon in the next MSw branch 1 releases.

If this available, you should remove the quick fix code in the browscap.module file.

See also http://drupal.org/node/1831658#comment-6780218

quiptime’s picture

Status: Active » Closed (fixed)

Fixed in 7.x-1.5 and the latest 7.x-1.x.

quiptime’s picture

Ups.

quiptime’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.