We are checking some strange behavior in our Catalog Import process, and I have found something in the Epi code that I would like to see if anyone has experience the same.
Let's assume the following scenario:
Attached you can find the DB queries in a screenshot.
We now want to add a new EntryRelation, between the Product 911819619 and the second variant 680255.So, we prepare the following XML file and use the CatalogImport API (Mediachase.Commerce.Catalog.ImportExport.Import).
<?xml version="1.0" encoding="utf-8"?>
<Catalogs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Catalog name="Products" lastmodified="2020-10-07T01:03:37.9880275Z" startDate="2020-10-07T01:03:37.988029Z" endDate="2040-10-07T01:03:37.9880304Z" defaultCurrency="usd" weightBase="lbs" defaultLanguage="en" sortOrder="0" isActive="true">
After we run the import, nothing happens and the new relation is not being added.
While digging into the code in the Import, I found something that called my attention in the EntryRelationsReader.cs
It seems that if the Parent Entry already has a RelationType (in this case "ProductVariation") existing for any other item, the relation is not added (since it seems it goes to the else section).
I have confirmed this while doing some testing, for instance, removing the existing relation and adding both of them together in the XML seems to be working fine.
This is Commerce 13.23.X
Is anyone aware of an issue here? Maybe this is done due to a restriction that I may not be aware?
This looks like a newly introduced bug to me. I will file a bug to Commerce team. Thank you for bringing this to our attention and apologies for any inconveniences it caused.
I think we can do some workaround in the meantime.
The bug (COM-12349) is now fixed and is waiting for release.
For anybody having the same issue - The fix was released in the end-of december and we have just confirmed that it works in our solutions.