I'm running into a problem where I get PDOExceptions thrown about unknown collumns.
I did see a couple bug reports about it in the issue queue, but they were marked as fixed. If I've overlooked an existing ticket, please feel free to close this issue and send me to the duplicate.
Here's how I produced the error:
- A Drupal install with field translation, entityreference and multilingual select turned on.
- I have two content types, "news" and "news category".
- Both content types use field translation as provided by the entity translation module.
- Both content types have the title replaced by an actual field, using the title module.
- Both content types have a default language set to "dutch", this language cannot be changed once applied and the language neutral option is disabled.
- The "news" content_type contains 1 entity_reference field.
- The entity_reference field is not translated.
- The entity_reference field can only reference nodes of type "news_category".
Expected behavior:
- To be able to create news_category nodes and news nodes.
- To be able to select a news_category node using the entity_reference field on the news node form.
- Because both content_types use field translation, I expect the nid to remain the same across translations (This is how field_translation works, right?)
- Because the entity_reference field is set to be not translatable, nodes are related by nid, and nid's don't change amongst translations, the nodes should then be related across translations.
Actual behavior:
- The following error when viewing, creating or editing a node of content_type 'news':
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_title_field0.nid' in 'on clause': SELECT DISTINCT field_data_title_field0.entity_type AS entity_type, field_data_title_field0.entity_id AS entity_id, field_data_title_field0.revision_id AS revision_id, field_data_title_field0.bundle AS bundle FROM {field_data_title_field} field_data_title_field0 INNER JOIN {node} node ON field_data_title_field0.nid = node.nid WHERE (field_data_title_field0.deleted = :db_condition_placeholder_0) AND (field_data_title_field0.entity_type = :db_condition_placeholder_1) AND (field_data_title_field0.bundle IN (:db_condition_placeholder_2)) AND (node.language IN (:db_condition_placeholder_3, :db_condition_placeholder_4)) ORDER BY field_data_title_field0.title_field_value ASC; Array ( [:db_condition_placeholder_0] => 0 [:db_condition_placeholder_1] => node [:db_condition_placeholder_2] => news_category [:db_condition_placeholder_3] => en [:db_condition_placeholder_4] => und ) in field_sql_storage_field_storage_query() (line 582 of /home/ruben/Eclipse Workspaces/Usendes/epst2/modules/field/modules/field_sql_storage/field_sql_storage.module).
I can spend a few hours trying to fix things, but I'm not familiar with either the source of either entity_translations or entityreference or even the entity API. So if anyone can point me in the right direction or if anyone knows a solution to this, any help is very much appreciated.