On Magento 2.4.6:
When our ERP executes an API request on the PUT method /all/V1/product/:sku
with the following JSON content:
{
"product": {
"custom_attributes": [
{
"attribute_code": "delais",
"value": "30"
}
]
}
}
Another attribute, warranty_type, also gets updated (its value becomes null) on this product, leading to the loss of information stored in this attribute, even though I did not request this update.
Furthermore, if I attempt to set warranty_type in the custom_attributes during the request submission, it does not seem to update and remains null instead of changing to standard.
Attribute configuration :
$eavSetup->addAttribute(
Product::ENTITY,
ProductAttributeInterface::WARRANTY_TYPE,
[
'type' => 'varchar',
'label' => 'Warranty type',
'input' => 'select',
'source' => WarrantyType::class,
'required' => false,
'sort_order' => 30,
'global' => ScopedAttributeInterface::SCOPE_STORE,
'group' => 'General',
'visible' => true,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => '',
'backend' => ArrayBackend::class,
'is_used_in_grid' => false,
'is_visible_in_grid' => false,
'is_filterable_in_grid' => false,
]
);
Note : on Mage 2.4.5, this work correctly
Thanks