Problem
I'm trying to locate a node using EntityFieldQuery. Using fieldCondition removes all of my search results. What am I doing wrong?
So Far
I've built my function using How to use EntityFieldQuery. It's running in a custom form submit.
function mymodule_form() {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'contact_details')
->fieldCondition('field_user_reference_manual', 'value', '154');
$result = $query->execute();
}
If I remove the fieldCondition query line it returns both contact_details nodes that I've created. One has field_user_reference_manual = 154
the other 140
The important values in my MySQL table are:
Field: field_data_field_user_reference_manual
Column: field_user_reference_manual_value
field_user_permission
. (I admit perhaps not the best naming scheme). I've tried the query with other fields oncontact_details
including a text one but none of them work.$query->addMetaData('account', user_load(1))
before it executes and see if that makes a difference