You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
In the import file product attribute's value is empty
Steps to reproduce
Run product import
Check product attribute's value in the DB
Expected result
Product attribute's value is empty after the import
Actual result
Product attribute's value is not updated to empty
Seems bit odd behaviour that attribute's value cannot be updated to empty via product import. System doesn't allow empty values to be set for non-static attributes.
public function clearEmptyData(array $rowData)
{
foreach ($this->_getProductAttributes($rowData) as $attrCode => $attrParams) {
if (!$attrParams['is_static'] && empty($rowData[$attrCode])) {
unset($rowData[$attrCode]);
}
}
return $rowData;
}
My suggestion is that shouldn't the product import check allowed values for the attribute instead of just checking if attribute is static or non-empty. This prevents also updating zero integer as a value, obviously.
@jarnooravainen thank you for your feedback.
Please provide exact detailed steps, with attributes examples.
Please also specify exact Magento version you are using.
From @jarnooravainen on June 20, 2017 9:29
Preconditions
Steps to reproduce
Expected result
Actual result
Seems bit odd behaviour that attribute's value cannot be updated to empty via product import. System doesn't allow empty values to be set for non-static attributes.
\Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType:
My suggestion is that shouldn't the product import check allowed values for the attribute instead of just checking if attribute is static or non-empty. This prevents also updating zero integer as a value, obviously.
Copied from original issue: magento/magento2#9990
The text was updated successfully, but these errors were encountered: