Import update skip setting updateBy attribute value

This commit is contained in:
Yurii
2026-05-28 15:13:27 +03:00
parent 07425a6c06
commit 4473dc9565

View File

@@ -501,7 +501,7 @@ class Import
$value = $row[$i];
try {
$this->processRowItem($entity, $attribute, $value, $valueMap);
$this->processRowItem($entity, $attribute, $value, $valueMap, $updateByAttributeList);
} catch (ValidationError $e) {
$failureList[] = $e->getFailure();
}
@@ -695,6 +695,7 @@ class Import
}
/**
* @param string[] $updateByAttributeList
* @throws ValidationError
*/
private function processRowItem(
@@ -702,6 +703,7 @@ class Import
string $attribute,
string $value,
stdClass $valueMap,
array $updateByAttributeList,
): void {
assert(is_string($this->entityType));
@@ -718,6 +720,14 @@ class Import
return;
}
if (
in_array($action, [Params::ACTION_CREATE_AND_UPDATE, Params::ACTION_UPDATE]) &&
in_array($attribute, $updateByAttributeList) &&
!$entity->isNew()
) {
return;
}
if ($entity->hasAttribute($attribute)) {
$attributeType = $entity->getAttributeType($attribute);