1

This question already has an answer here:

I am getting a PDO error which seems related to the Mass Contact module. I installed, played with and then disabled the Mass Contact module. Now when I run cron I get the error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.field_data_field_mass_contact_category' doesn't exist: SELECT field_data_field_mass_contact_category0.entity_type AS entity_type, field_data_field_mass_contact_category0.entity_id AS entity_id, field_data_field_mass_contact_category0.revision_id AS revision_id, field_data_field_mass_contact_category0.bundle AS bundle FROM {field_data_field_mass_contact_category} field_data_field_mass_contact_category0 WHERE (field_data_field_mass_contact_category0.deleted = :db_condition_placeholder_0) AND (field_data_field_mass_contact_category0.bundle = :db_condition_placeholder_1) LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => mass_contact ) in field_sql_storage_field_storage_query() (line 585 of /var/www/modules/field/modules/field_sql_storage/field_sql_storage.module)

If I try to uninstall Mass Contact I get the error:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.field_data_field_mass_contact_category' doesn't exist: UPDATE {field_data_field_mass_contact_category} SET deleted=:db_update_placeholder_0; Array ( [:db_update_placeholder_0] => 1 ) in field_sql_storage_field_storage_delete_field() (line 312 of /var/www/modules/field/modules/field_sql_storage/field_sql_storage.module).

The table 'field_data_field_mass_contact_category' does not exist. It is not even created if I enable the Mass Contact module and create a category.

I have tried clearing all cache tables (using phpmyadmin) both with the Mass Contact module enabled and disabled.

I am using Drupal 7.32 on ubuntu localhost.

I have no idea how to proceed. I have found no relevent solution searching the questions here with "PDOException: SQLSTATE[42S02]: Base table or view not found". Any help/advice about how to proceed to track this problem down appreciated.

marked as duplicate by kiamlaluno Aug 2 '15 at 17:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

I just had the same similar situation happen just today. I'm not sure if you resolved your issue, but in case you or others have the problem again, there's a simple solution that worked for me.

I'll post it here, but please go to this link (https://www.drupal.org/node/2417855) as a reference to my situation... thanks!

This is the error message I was getting PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbxxx.xxxfile_metadata' doesn't exist: SELECT * FROM {file_metadata} WHERE fid IN (:fids_0); Array ( [:fids_0] => 38 ) in file_entity_file_load() (line 201 of /sites/all/modules/file_entity/file_entity.file.inc)

Here's what I did:

UPDATE

I did my own recon work ... somehow, I was able to get out of the situation and the error message disappeared. I am either very resourceful or EXTREMELY lucky!! lol

Here's what I did before the error message ... I Installed and enabled the following modules:

Media and File_Entity ... then the error showed up and froze me I then tried to disable, but it wouldn't let me. Here's what I did AFTER the error message to fix the problem:

I went directly to the database and disabled the two modules within then I ran the "update.php" from my site It then processed the "file_entity" module All is good now I'm guessing the module did not upload properly ... I don't know, but I'm back online again... whew =)

I hope this helps =)

0

I have been there before. What I recommend is that you create a 'fake' table so the uninstaller can run. Just add these two tables to your database and any subsequent one it is trying to find:

"field_data_field_mass_contact_category" "field_revision_field_mass_contact_category"

Then run the un-install.

There are a few other ways you can do it but think this is the easiest.

  • Thanks for the response. Presumably I should create these tables using phpmyadmin. Does it matter what fields I create on the tables? – Polly Nov 9 '14 at 12:52
  • I created the tables with an int "id" col. Running the uninstall I now get: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'deleted' in 'field list': UPDATE {field_data_field_mass_contact_category} SET deleted=:db_update_placeholder_0; Array ( [:db_update_placeholder_0] => 1 ) in field_sql_storage_field_storage_delete_field() (line 312 of /var/www/modules/field/modules/field_sql_storage/field_sql_storage.module). Should I create a column 'deleted' on the tables? – Polly Nov 9 '14 at 13:02
  • I added 'deleted' (tinyint) col and on uninstall I now get: DatabaseSchemaObjectExistsException: Cannot rename <em class="placeholder">field_data_field_mass_contact_category</em> to <em class="placeholder">field_deleted_data_132</em>: table <em class="placeholder">field_deleted_data_132</em> already exists. in DatabaseSchema_mysql->renameTable() (line 307 of /var/www/includes/database/mysql/schema.inc). – Polly Nov 9 '14 at 13:09
  • The table 'field_deleted_data_132' exists and includes the fields "field_mass_contact_category_value" & "field_mass_contact_category_format". The table is empty. – Polly Nov 9 '14 at 13:13
  • Tables 'field_deleted_data_131' - 'field_deleted_data_137' all seem related to Mass Contact. Should I start deleting these tables? – Polly Nov 9 '14 at 13:26
0

Definitely, Install file is not properly addressed or there may be spelling mistake in it. Install file. Please provide snapshot of that file, or fix that error manually, usually problem may be hook_uninstall schema is not properly configured to wipe out the table when Uninstaller is clicked in module administration page.

Not the answer you're looking for? Browse other questions tagged or ask your own question.