Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By elivol on
Hello,
For a 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 I get this 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