diff --git a/src/AppBundle/Command/ImportStdCommand.php b/src/AppBundle/Command/ImportStdCommand.php index e98e1766..704e577d 100755 --- a/src/AppBundle/Command/ImportStdCommand.php +++ b/src/AppBundle/Command/ImportStdCommand.php @@ -569,10 +569,6 @@ protected function getEntityFromData(string $entityName, array $data, array $man $this->copyKeyToEntity($entity, $entityName, $data, $key, true); } - foreach ($optionalKeys as $key) { - $this->copyKeyToEntity($entity, $entityName, $data, $key, false); - } - foreach ($foreignKeys as $key) { $foreignEntityShortName = ucfirst(str_replace('_code', '', $key)); @@ -601,6 +597,10 @@ protected function getEntityFromData(string $entityName, array $data, array $man } } + foreach ($optionalKeys as $key) { + $this->copyKeyToEntity($entity, $entityName, $data, $key, false); + } + // special case for Card if ($entity instanceof Card) { // calling a function whose name depends on the type_code