diff -u b/src/Plugin/migrate/process/EntityGenerate.php b/src/Plugin/migrate/process/EntityGenerate.php --- b/src/Plugin/migrate/process/EntityGenerate.php +++ b/src/Plugin/migrate/process/EntityGenerate.php @@ -98,12 +98,12 @@ throw new MigrateException('The entity_generate plugin found no bundle but destination entity requires one.'); } - // Creates a stub entity if one doesn't exist. - if (!($result = $this->query($value, $bundle))) { + // Creates a stub entity if one doesn't exist and stubbing isn't disabled. + if (!($result = $this->query($value, $bundle)) && empty($this->configuration['no_stub'])) { return $this->generateEntity($value, $bundle); } - return $result; + return $result ?: NULL; } @@ -130,13 +130,11 @@ } $results = $query->execute(); - if ($ignoreCase) { + // By default do a case-sensitive comparison. + if (!$ignoreCase) { // Returns the entity's identifier. - $valueLower = strtolower($value); - $identifiers = $this->entityManager->getStorage($this->entityType)->loadMultiple($results); - - foreach ($identifiers as $identifier => $entity) { - if ($valueLower == strtolower($entity->{$this->valueKey}->value())) { + foreach ($this->entityManager->getStorage($this->entityType)->loadMultiple($results) as $identifier => $entity) { + if ($value === $entity->{$this->valueKey}->value()) { return $identifier; } }