mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-10 15:12:12 +00:00
Allow to automatically create new manufacturers within quick apply
This commit is contained in:
parent
2ab355fd1f
commit
7c056c5dff
1 changed files with 7 additions and 0 deletions
|
|
@ -576,6 +576,13 @@ class BulkInfoProviderImportController extends AbstractController
|
|||
$providerPart = $infoRetriever->dtoToPart($dto);
|
||||
$partMerger->merge($part, $providerPart);
|
||||
|
||||
//Persist part manufacturer and supplier if they are new, to avoid issues with detached entities during merge
|
||||
//Do not footprints here, as it might pollute the database with unwanted formatting footprints from the provider,
|
||||
$this->entityManager->persist($part->getManufacturer());
|
||||
foreach ($part->getOrderdetails() as $orderdetail) {
|
||||
$this->entityManager->persist($orderdetail->getSupplier());
|
||||
}
|
||||
|
||||
try {
|
||||
$this->entityManager->flush();
|
||||
} catch (ORMInvalidArgumentException $exception) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue