Quantcast
Viewing all articles
Browse latest Browse all 293902

PDOException: Column not found: .nid in field_sql_storage_field_storage_query() (line 587 of field_sql_storage.module)

I have a content type that has an entity reference to another content type. When I go to create a new node using sitename/node/add/type-name, I get the following error. There is a join from the entity table to node_access where the script is trying to join using the entity table's .nid column, which doesn't exist. Instead join to the .entity_id column.

Adding a new node works fine when I'm logged in as admin, its only when I don't have admin privileges when this problem occurs. For now I am getting around this problem by adding a 'nid' column to the table and setting up a MySQL procedure
to keep it in sync with entity_id. Ugh!

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_theme_camp_name0.nid' in 'where clause': SELECT field_data_field_theme_camp_name0.entity_type AS entity_type, field_data_field_theme_camp_name0.entity_id AS entity_id, field_data_field_theme_camp_name0.revision_id AS revision_id, field_data_field_theme_camp_name0.bundle AS bundle FROM {field_data_field_theme_camp_name} field_data_field_theme_camp_name0 WHERE (field_data_field_theme_camp_name0.deleted = :db_condition_placeholder_0) AND (field_data_field_theme_camp_name0.entity_type = :db_condition_placeholder_1) AND (field_data_field_theme_camp_name0.bundle IN (:db_condition_placeholder_2)) AND(( ( EXISTS (SELECT na.nid AS nid FROM {node_access} na WHERE (( (na.gid = :db_condition_placeholder_3) AND (na.realm = :db_condition_placeholder_4) ))AND (na.grant_view >= :db_condition_placeholder_5) AND
(field_data_field_theme_camp_name0.entity_id = na.nid) )) AND
(field_data_field_theme_camp_name0.entity_type = :db_condition_placeholder_6) )OR (field_data_field_theme_camp_name0.entity_type <> :db_condition_placeholder_7) )AND
( EXISTS (SELECT na.nid AS nid FROM {node_access} na WHERE
(( (na.gid = :db_condition_placeholder_8) AND
(na.realm = :db_condition_placeholder_9) ))AND
(na.grant_view >= :db_condition_placeholder_10) AND
(field_data_field_theme_camp_name0.nid = na.nid) )) ORDER BY field_data_field_theme_camp_name0.field_theme_camp_name_value DESC; Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => node [:db_condition_placeholder_2] => theme_camp [:db_condition_placeholder_3] => 0 [:db_condition_placeholder_4] => all [:db_condition_placeholder_5] => 1 [:db_condition_placeholder_6] => node [:db_condition_placeholder_7] => node [:db_condition_placeholder_8] => 0 [:db_condition_placeholder_9] => all [:db_condition_placeholder_10] => 1 ) in field_sql_storage_field_storage_query() (line 587 of /home/drupal/d7/modules/field/modules/field_sql_storage/field_sql_storage.module).

Viewing all articles
Browse latest Browse all 293902

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>