the simple product , after addParentVariantLink, still contains the variantLink with an unmanaged parentProduct in the parentVariantLinks collection
the simple product is being persisted and during flush A new entity was found through the relationship exception occurs.
Steps to reproduce
cli import a csv file with configurable products with at least 1 invalid configurable product
Actual Result
none of the products are imported.
Following exception is thown:
[Doctrine\ORM\ORMInvalidArgumentException] A new entity was found through the relationship 'Oro\Bundle\ProductBundle\Entity\ProductVariantLink#parentProduct'
Expected Result
Details about your environment
starting from OroCommerce version: 3.1.16 CE / Enterprise
Summary
since the changes in https://github.com/oroinc/orocommerce/blob/a254632a1d0683bc28f50ae6c6b142bc895be26f/src/Oro/Bundle/ProductBundle/Entity/ProductVariantLink.php#L142 and adding the parent variant link to the child import of configurable products is broken if an invalid configurable exists in an import batch.
A new entity was found through the relationship
exception occurs.Steps to reproduce
cli import a csv file with configurable products with at least 1 invalid configurable product
Actual Result none of the products are imported. Following exception is thown:
[Doctrine\ORM\ORMInvalidArgumentException] A new entity was found through the relationship 'Oro\Bundle\ProductBundle\Entity\ProductVariantLink#parentProduct'
Expected Result
Details about your environment