Skip to content

Commit

Permalink
Fix d8 User Entity Reference fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Sut3kh committed Nov 20, 2017
1 parent a85eaad commit 3e8515f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3e8515f

Please sign in to comment.