Running core drupal version 7.8

After turning on Stylizer, I get this error:

DatabaseSchemaObjectExistsException: Table stylizer already exists. in DatabaseSchema->createTable() (line 652 of /Users/user/Desktop/i_health3/includes/database/schema.inc).

Afterwards, I noticed both Stylizer & Color were on.
Any idea why it's doing this?

Comments

merlinofchaos’s picture

Category: bug » support
Status: Active » Fixed

It seems stylizer had already been enabled sometime in the past and that the database tables had already been created. I've found Drupal sometimes does this and I've never had any luck figuring out the circumstances of it. Sometimes restoring backup databases or what not can throw things out of sync.

If things appear to be working afterward, then you're fine. If not, you might consider uninstalling stylizer and reinstalling it to make sure the table schema is correct. But I don't think it has changed much.

atmosfearic1’s picture

it's happening a lot on this project! I don't know what to do, should I start over or try to fix these issues?
For example I just went to Structure to add a new content type. I named it Article 2 and when I saved it:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'i_health3.cache_views' doesn't exist: TRUNCATE {cache_views} ; Array ( ) in cache_clear_all() (line 169 of /Users/user/Desktop/i_health3/includes/cache.inc).

Then when I go in to manage the fields, it lets me edit fields but when I saved it, I got this:

Notice: Undefined index: article_2 in _field_ui_bundle_admin_path() (line 309 of /Users/user/Desktop/i_health3/modules/field_ui/field_ui.module).

Then when I close it & re-open it doesn't have the error, so I edit the fields & saved it & got this error:

Add new field: the field name field_tags already exists.

Then when I go back to it, nothing was saved!

merlinofchaos’s picture

Oh wow. Yes, your database is wildly out of sync.

The only cures are 1) make sure update.php has been run, and 2) when you see modules doing that, completely uninstall and reinstall them. Usually you can tell from a table name which module owns it (cache_views is owned by Views, for example). That Exception probably caused queries to stop executing part way through, leaving field API in a broken state. :/

atmosfearic1’s picture

Thanks for the tip merlin!

Status: Fixed » Closed (fixed)

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