Skip to content

Commit

Permalink
AKM-24: Connector fails because of invalid entities
Browse files Browse the repository at this point in the history
  • Loading branch information
dxops committed Jul 8, 2021
1 parent 76eaa19 commit 0bf54f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions ImportExport/Strategy/CategoryImportStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,10 @@ protected function updateRelations($entity, array $itemData = null)
true
);

$key = $relationCollection->indexOf($collectionEntity);
$relationCollection->removeElement($collectionEntity);
if ($existingCollectionEntity) {
if (!$relationCollection->contains($existingCollectionEntity)) {
$relationCollection->removeElement($collectionEntity);
$relationCollection->add($existingCollectionEntity);
}

$relationCollection->set($key, $existingCollectionEntity);
$this->cacheInverseFieldRelation($entityName, $fieldName, $existingCollectionEntity);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ImportExport/Strategy/ImportStrategyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function importEntity($databaseEntity, $importedEntity, array $excludedPr
/**
* {@inheritdoc}
*/
protected function getEntityPropertiesByClassName($entityClassName)
private function getEntityPropertiesByClassName($entityClassName)
{
/*
* In case if we work with configured entities then we should use fieldHelper
Expand Down

0 comments on commit 0bf54f5

Please sign in to comment.