diff -u b/src/Plugin/migrate/process/EntityLookup.php b/src/Plugin/migrate/process/EntityLookup.php --- b/src/Plugin/migrate/process/EntityLookup.php +++ b/src/Plugin/migrate/process/EntityLookup.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; @@ -24,7 +24,7 @@ * id = "entity_lookup" * ) * - * In it's most simple form, this plugin needs no configuration. However, if the + * In its most simple form, this plugin needs no configuration. However, if the * lookup properties cannot be determined through introspection, define them via * configuration. * @@ -58,10 +58,10 @@ /** @var \Drupal\Core\Entity\EntityManagerInterface */ protected $entityManager; - /** @var \Drupal\migrate\Entity\MigrationInterface */ + /** @var \Drupal\migrate\Plugin\MigrationInterface */ protected $migration; - /** @var Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface */ + /** @var \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface */ protected $selectionPluginManager; /** @var string */ @@ -186,8 +186,8 @@ * @param $value * The value to query. * - * @return mixed|bool - * Entity id if the queried entity exists. Otherwise FALSE. + * @return mixed|null + * Entity id if the queried entity exists. Otherwise NULL. */ protected function query($value) { // Entity queries typically are case-insensitive. Therefore, we need to @@ -204,6 +204,10 @@ } $results = $query->execute(); + if (empty($results)) { + return NULL; + } + // By default do a case-sensitive comparison. if (!$ignoreCase) { // Returns the entity's identifier.