ACSD-63454: The default value for Dropdown and Multiple Select attributes is not saved correctly…
The default value for Dropdown and Multiple Select attributes is not saved correctly in the database; instead of updating the default value, the new value is appended to the old one, separated by a comma. Quality patch ACSD-63454 for magento/module-catalog applies to Magento Open Source and Adobe Commerce 2.4.7 to 2.4.7-p10.
- Categories
- Admin, Other
- Components
- magento/module-catalog, magento/module-eav, magento/module-swatches
- Origin
- adobe-commerce-support
- Since QPT
- 1.1.59
Issue
The default value for Dropdown and Multiple Select attributes is not saved correctly in the database; instead of updating the default value, the new value is appended to the old one, separated by a comma.
Steps to reproduce
1. Login to the backend, go to Stores > Attributes > Product. 1. Click Add New Attribute. 1. In the Properties tab, set the following: * Default Label: test * Catalog Input Type for Store Owner: Multiple Select * Manage Options: Add two options without selecting Is Default. 1. Click Save Attribute. 1. Check in the databasse that the default_value column is empty. select attribute_code, default_value from eav_attribute where attribute_code = 'test'; 1. Go back and set one of the two options as Is Default. 1. Check the database again to ensure that default_value now contains the selected option ID. 1. Go back and change the default option by selecting the other option.
Adobe's page lists 2.4.7 - 2.4.7-p3 as compatible; the versions below are resolved from the current QPT constraints and are the ones the tool will offer.
Adobe scheduled the permanent fix for 2.4.8.
Install
Install the Quality Patches Tool with composer require magento/quality-patches, apply the prerequisites listed for all files applicable to your distribution and version first, then run vendor/bin/magento-patches apply ACSD-63454. On Cloud, add ACSD-63454 under stage.build.QUALITY_PATCHES in .magento.env.yaml.
For cweagans/composer-patches, choose a compatible version below and download the bundle. Copy its ACSD-63454/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Bundle prerequisites the same way and list them first. Paths are relative to each package root, using the default -p1 level. Prefer local files when configuring composer-patches; a remote URL can change.
Patch files and compatible versions
magento/magento2-base >=2.4.7 <2.4.8
- Magento Open Source
- 2.4.7-p10, 2.4.7-p9, 2.4.7-p8, 2.4.7-p7, 2.4.7-p6, 2.4.7-p5, 2.4.7-p4, 2.4.7-p3, 2.4.7-p2, 2.4.7-p1, 2.4.7
- Adobe Commerce
- 2.4.7-p10, 2.4.7-p9, 2.4.7-p8, 2.4.7-p7, 2.4.7-p6, 2.4.7-p5, 2.4.7-p4, 2.4.7-p3, 2.4.7-p2, 2.4.7-p1, 2.4.7
- Patch file
- patches/os/ACSD-63454_2.4.7-p2.patch
- vendor/magento/module-catalog/Controller/Adminhtml/Product/Attribute/Save.php
- vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml
- vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/options.phtml
- vendor/magento/module-catalog/view/adminhtml/web/js/options.js
- vendor/magento/module-eav/Model/ResourceModel/Entity/Attribute.php
- vendor/magento/module-swatches/view/adminhtml/templates/catalog/product/attribute/text.phtml
- vendor/magento/module-swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml
- vendor/magento/module-swatches/view/adminhtml/web/js/text.js
- vendor/magento/module-swatches/view/adminhtml/web/js/visual.js
