I need to filter an EntityFieldQuery with a given workflow state, let's say workflow it is state 21 (
sid = 21). Below, the query I am using
$query_formularios_completos = new EntityFieldQuery(); $query_formularios_completos ->entityCondition('entity_type', 'node') ->propertyCondition('type', array( 'evento_agencia', 'evento_energia' ) ) ->propertyCondition('workflow', 21) ->fieldCondition('field_e_expositor', 'target_id', $node_expositor_nid); $result_formularios_completos = $query_formularios_completos->execute();
When using DEVEL to inspect my node, I can see there is a property
->workflow, side by side with ordinary properties like
->created. Although I can see it there and I expected to filter only items with workflow state 21, I get a horrid database error when trying to execute the code above. Here is more or less the message I get:
Column not found: 1054 Column 'node.workflow' unknown in 'where clause'
Any ideas on how I should filter an entity query using a workflow state as filter? Maybe what I am trying to do isn'tpossible and I have to actually run a query using db_query and applying the appropriate joins.