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
When sending products via asyn bulk api where there are products with missing attributes, they will bypass the validation and empty products are created in Magento.
This happends when there is a product with a non default attribute set which already exists and after this product a new product with default attribute set is handled. This attribute set Id is not loaded, only the former attributeset. Then when checking if attributes are applicable it is not passed the isInSet and the attribute is not validated. And the product can be created even with missing attributes.
files:
vendor/magento/module-catalog/Model/ResourceModel/AbstractResource.php line 86
vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php line 745
vendor/magento/module-catalog/Model/ProductRepository.php line 579
vendor/magento/module-eav/Model/Entity/Attribute/Set.php line 311
The existing product needs to have an custom attribute set. The second will fallback on the default. When the first is handled the custom attribute set is loaded by $productAttributes = $product->getAttributes(); in the ProductRepository after the validation is done. Then when the 2nd product is handled the attribute set which is diffirent from the first one, is not loaded and when checking if the attribute set id is on the attribute it fails and then the attribute is not applicable and is not handled by the validation.
Expected result
Products with missing data for required attributes are not created
Actual result
products with missing data are being created
Additional information
No response
Release note
No response
Triage and priority
Severity: S0- Affects critical data or functionality and leaves users without workaround.
Severity: S1- Affects critical data or functionality and forces users to employ a workaround.
Severity: S2- Affects non-critical data or functionality and forces users to employ a workaround.
Severity: S3- Affects non-critical data or functionality and does not force users to employ a workaround.
Severity: S4- Affects aesthetics, professional look and feel, “quality” or “usability”.
The text was updated successfully, but these errors were encountered:
Hi @mhaagen85. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel. ⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
Temp fix. trigger get attributes before the validation in Model/ProductRepository.php: $product->getAttributes(); $validationResult = $this->resourceModel->validate($product);
Preconditions and environment
files:
Steps to reproduce
Send 2 product via async/bulk/V1/products: for example:
[ { "product": { "sku": "existing sku", "type_id": "simple", "created_at": null, "updated_at": null, "custom_attributes": [ { "attribute_code": "cost", "value": "201.96" } ] } }, { "product": { "sku": "new sku", "type_id": "simple", "created_at": null, "updated_at": null, "custom_attributes": [ { "attribute_code": "cost", "value": "28.65" } ] } } ]
The existing product needs to have an custom attribute set. The second will fallback on the default. When the first is handled the custom attribute set is loaded by $productAttributes = $product->getAttributes(); in the ProductRepository after the validation is done. Then when the 2nd product is handled the attribute set which is diffirent from the first one, is not loaded and when checking if the attribute set id is on the attribute it fails and then the attribute is not applicable and is not handled by the validation.
Expected result
Products with missing data for required attributes are not created
Actual result
products with missing data are being created
Additional information
No response
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: