diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index e1b1c2a..b9153a7 100755 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -71,10 +71,14 @@ protected static function getUriAsDisplayableString($uri) { } elseif ($scheme === 'entity') { list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2); - // Show the 'entity:' URI as the entity autocomplete would. - $entity_manager = \Drupal::entityManager(); - if ($entity_manager->getDefinition($entity_type, FALSE) && $entity = \Drupal::entityManager()->getStorage($entity_type)->load($entity_id)) { - $displayable_string = EntityAutocomplete::getEntityLabels([$entity]); + // @todo Support entity types other than 'node'. Will be fixed in + // https://www.drupal.org/node/2423093. + if($entity_type == 'node') { + // Show the 'entity:' URI as the entity autocomplete would. + $entity_manager = \Drupal::entityManager(); + if ($entity_manager->getDefinition($entity_type, FALSE) && $entity = \Drupal::entityManager()->getStorage($entity_type)->load($entity_id)) { + $displayable_string = EntityAutocomplete::getEntityLabels([$entity]); + } } }