I have read the other SQLSTATE[42S22] questions here, and they seem to all be about modules that have not completed setup properly, but I think my issue is different.
Whenever I try to delete a field the following error shows up:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column
'field_data_field_doc_file0.field_doc_file_value' in 'where clause':
SELECT field_data_field_doc_file0.entity_type AS entity_type,
field_data_field_doc_file0.entity_id AS entity_id,
field_data_field_doc_file0.revision_id AS revision_id,
field_data_field_doc_file0.bundle AS bundle FROM
{field_data_field_doc_file} field_data_field_doc_file0 WHERE
(field_data_field_doc_file0.field_doc_file_value = :db_condition_placeholder_0)
AND (field_data_field_doc_file0.deleted = :db_condition_placeholder_1) ;
Array ( [:db_condition_placeholder_0] => 61531 [:db_condition_placeholder_1] => 0 )
in field_sql_storage_field_storage_query()
(line 652 of /path/to/drupal/modules/field/modules/field_sql_storage/field_sql_storage.module).
It seems that perhaps some previous field deletion went awry or something? If I hit the back button it does appear that my field has been deleted, but I fear that if I keep deleting fields, I may be digging myself into a much worse problem to untangle. What would be the best course of action to resolve this issue, and get rid of these db errors? I'll start by looking at the field_sql_storage module, but suspect I'm not familiar enough with drupal yet, to quickly ascertain what is going wrong via that route.
UPDATE: Line 652 of that module is the last line of the field_sql_storage_field_storage_query
method:
return $query->finishQuery($select_query, $id_key);
UPDATE 2: I found the entity with the id in [:db_condition_placeholder_0]
in a table called field_deleted_data_143
, but I haven't find a column named field_doc_file_value
anywhere yet (The deleted table has a field_doc_file_title_value
table). The FROM portion of the query is FROM {field_data_field_doc_file} field_data_field_doc_file0
, but I don't know what table {field_data_field_doc_file}
represents here. Is it field_data_field_doc_file
(which is an empty table), or are do those curly brackets mean that name is being replaced with something else?
I guess maybe the next step is to try adding the column to the table.