Skip to content

Commit

Permalink
Merge pull request #604 from plural/fix-card-importer
Browse files Browse the repository at this point in the history
Process foreign keys before optional fields to fix dependency order.
  • Loading branch information
plural authored Mar 6, 2022
2 parents f0fd166 + 9ba8901 commit 95571a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/AppBundle/Command/ImportStdCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 95571a5

Please sign in to comment.