I removed Browscap from my site and dropped all Browscap tables because my "Show in Mobile" tab was duplicated on block configuration.

Now, when I reinstall Browscap, it breaks my site. It does not create new tables so I guess that is the problem. Can anyone tell me how to get Browscap reinstalled and running?

I have tried both 7.x-2.0 and 7.x-2.x-dev

Comments

Homotechsual’s picture

Also experiencing this as a problem... Error message follows:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'DBNAME.x_browscap' doesn't exist: SELECT * FROM {browscap} WHERE :useragent LIKE useragent ORDER BY LENGTH(useragent) DESC; Array ( [:useragent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0 FirePHP/0.7.1 ) in browscap_get_browser() (line 103 of /public_html/sites/all/modules/browscap/browscap.module).

Database and Path details have been removed from the message above

Any advice on how to fix this would be appreciated.

Homotechsual’s picture

Title: Breaks site » Throwing PDO Exception (Database tables not being created)
Version: 7.x-2.0 » 7.x-2.x-dev
Component: Miscellaneous » Code
Priority: Major » Critical

Edited title.

greggles’s picture

Category: bug » support
Status: Active » Fixed

When you disabled the module it sounds like you didn't remove records about it from the system table. Here are the steps for a manual removal:

1. drop table browscap;
2. delete from variable where name in ('browscap_imported', 'browscap_version', 'browscap_enable_automatic_updates', 'browscap_automatic_updates_timer')
3. delete from system where name = 'browscap';

Once you've done those three things you should be able to reinstall without issue.

In the future, there is a user interface for disabling and uninstalling modules that will do all this for you. I encourage you to use it :)

Status: Fixed » Closed (fixed)

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