diff --git a/src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php b/src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php index 0552b6fe..e2c8fc3f 100644 --- a/src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php +++ b/src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php @@ -14,7 +14,15 @@ public function expand($values) { $return = array(); $entity_type_id = $this->fieldInfo->getSetting('target_type'); $entity_definition = \Drupal::entityManager()->getDefinition($entity_type_id); - $label_key = $entity_definition->getKey('label'); + + // Determine label field key. + if ($entity_type_id !== 'user') { + $label_key = $entity_definition->getKey('label'); + } + else { + // Entity Definition->getKey('label') returns false for users. + $label_key = 'name'; + } // Determine target bundle restrictions. $target_bundle_key = NULL;