The MDVA-29148 patch solves the issue where \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
does not assign the default value on save. This patch is available when the Magento Quality Patch (MQP) tool v.1.0.7 is installed. Please note that the issue is scheduled to be fixed in Magento version 2.4.2.
Affected products and versions
- This patch was designed for Magento Commerce Cloud 2.3.3-p1.
The patch is also compatible with the following Magento versions and editions: Magento Commerce/Magento Commerce Cloud >=2.3.0 <2.4.2.
Note: the patch can be applicable to other versions. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
When a product is created via an import script or the REST API, attributes that use the \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
backend model and have a default value, are not assigned the default value.
Steps to reproduce
- Create a new global attribute that uses the
\Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend
backend model and a non-empty default value. - Use the REST API to create a new product.
- Fetch that new product from the REST API and confirm that the attribute is not present in the products custom attributes.
Actual result
The custom attribute default value was not saved to the product attribute.
Expected result
The custom attribute default value was saved to the product attribute.
Apply the patch
For instructions on how to apply an MQP patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Apply patches using Magento Quality Patches Tool.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply patches.
Related reading
To learn more about Magento Quality Patches, refer to:
- Magento Quality Patches released: a new tool to self-serve quality patches.
- Check if patch is available for your Magento issue using Magento Quality Patches.
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.