Referencing to a node works fine but when I try to reference to a file I get following error:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fm.status' in 'where clause': SELECT file_managed.fid AS entity_id, file_managed.type AS bundle, :entity_type AS entity_type, NULL AS revision_id FROM {file_managed} file_managed WHERE (file_managed.type IN (:db_condition_placeholder_0)) AND (status = :db_condition_placeholder_1) AND (fm.status = :db_condition_placeholder_2) AND (fm.uri NOT LIKE :db_condition_placeholder_3 ESCAPE '\\') ; Array ( [:db_condition_placeholder_0] => brochure [:db_condition_placeholder_1] => 1 [:db_condition_placeholder_2] => 1 [:db_condition_placeholder_3] => temporary% [:entity_type] => file ) in EntityFieldQuery->execute() (line 1155 of ..\includes\entity.inc).
Backtrace:
PDOStatement->execute(Array) database.inc:2168
DatabaseStatementBase->execute(Array, Array) database.inc:680
DatabaseConnection->query('SELECT file_managed.fid AS entity_id, file_managed.type AS bundle, :entity_type AS entity_type, NULL AS revision_id
FROM
{file_managed} file_managed
WHERE (file_managed.type IN (:db_condition_placeholder_0)) AND (status = :db_condition_placeholder_1) AND (fm.status = :db_condition_placeholder_2) AND (fm.uri NOT LIKE :db_condition_placeholder_3 ESCAPE '\\') ', Array, Array) select.inc:1264
SelectQuery->execute() entity.inc:1331
EntityFieldQuery->finishQuery(Object) entity.inc:1282
EntityFieldQuery->propertyQuery(Object)
call_user_func(Array, Object) entity.inc:1155
EntityFieldQuery->execute() EntityReference_SelectionHandler_Generic.class.php:167
EntityReference_SelectionHandler_Generic->getReferencableEntities() entityreference.module:765
entityreference_options_list(Array, Array, 'node', Object)
call_user_func_array('entityreference_options_list', Array) module.inc:833
module_invoke('entityreference', 'options_list', Array, Array, 'node', Object) options.module:245
_options_get_options(Array, Array, Array, 'node', Object) options.module:86
options_field_widget_form(Array, Array, Array, Array, 'und', Array, 0, Array) field.form.inc:112
field_default_form('node', Object, Array, Array, 'und', Array, Array, Array) field.attach.inc:209
_field_invoke('form', 'node', Object, Array, Array, Array) field.attach.inc:385
_field_invoke_default('form', 'node', Object, Array, Array, Array) field.attach.inc:574
field_attach_form('node', Object, Array, Array, 'en') node.pages.inc:326
node_form(Array, Array, Object)
call_user_func_array('node_form', Array) form.inc:798
drupal_retrieve_form('product_display_node_form', Array) form.inc:339
drupal_build_form('product_display_node_form', Array) form.inc:131
drupal_get_form('product_display_node_form', Object) node.pages.inc:14
node_page_edit(Object)
call_user_func_array('node_page_edit', Array) entity_translation.module:663
_entity_translation_callback('node_page_edit', Array, Array) entity_translation.module:540
entity_translation_edit_page('node', Object, , Array, Object)
call_user_func_array('entity_translation_edit_page', Array) menu.inc:517
menu_execute_active_handler() index.php:33
Comments
Comment #1
toddwoof commentedI'm getting a similar error when attempting to edit a node title in a case where the node is already Entity-referenced to a Document file (using autocomplete widget).
That is: I can edit node title of this content type if there are no actual references to a file entity, but if there are any references, I can't edit it.
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'fm.status' in 'where clause': SELECT file_managed.fid AS entity_id, file_managed.type AS bundle, :entity_type AS entity_type, NULL AS revision_id FROM {file_managed} file_managed WHERE (file_managed.fid IN ...
Comment #2
sill commentedI'm also getting the same error....
I did a work around of creating an 'entity reference' view which is what is used to populate the autocomplete field. When I use this system I don't get the error and the autocomplete functionality is actually useable.
Comment #3
alan d. commentedLooks related to File Entity. I just had an issue with LinkIt and this was resolved in the latest release - File Entity 7.x-2.0-alpha2. Hope it helps ;)
Comment #4
geek-merlinI've had the same exception when i added a sort-by-field (that is not on all bundles if that matters).
Removing the sort and no exception anymore.