I use Drupal 7. This code:
$query = new EntityFieldQuery();
$resFirstName = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'user')
->fieldCondition('field_user_first_name', 'value', $str, 'RLIKE')
->range(0, 15)
->addTag('node_access')
->execute();
when site's user isn't Admin throws the following error:
"PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_user_first_name0.nid' in 'where clause': SELECT field_data_field_user_first_name0.entity_type AS entity_type, ..."
If I remove ->fieldCondition('field_user_first_name', 'value', $str, 'RLIKE')
or ->addTag('node_access')
- no error.
Thanks