-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Component: Framework/AppEvent: mm20inIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Description
I didn't found any related issues in your backlog, if it actually already exists, my apologies.
## Unhanded event when the "Use system value" is triggered in the store configuration admin interface.
Preconditions
- Magento 2.4-develop
- Custom configuration as following (simplified) in system.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="system">
<group id="my_custom_settings" translate="label" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1">
<label>My Custom Settings</label>
<field id="custom_field_disable" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Disable Button</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
<field id="custom_field_value" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Select Field</label>
<source_model>Vendor\Module\Model\Config\Source\MyOptions</source_model><!-- return empty array or first value is empty -->
<can_be_empty>0</can_be_empty>
<validate>required-entry</validate>
<depends>
<field id="custom_field_disable">0</field>
</depends>
</field>
</group>
</section>
</system>
</config>
- Default configuration values in the config.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<system>
<my_custom_settings>
<custom_field_disable>1</custom_field_disable>
</my_custom_settings>
</system>
</default>
</config>
Steps to reproduce
- Add above content in the system.xml and config.xml of a custom module
- Clear the cache
- Go to store > config > Advanced > System > My Custom Settings
- Uncheck "Use system value" of the "Disable Button" field
- Check value "Yes"
- "Select Field" field appear, (do not select any value)
- Check "Use system value" of the "Disable Button" field
Expected result
- The depends fields should disappears
- We are able to save the config
Actual result
Workaround
- Select manually the value of the first field
Metadata
Metadata
Assignees
Labels
Component: Framework/AppEvent: mm20inIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.May be fixed according to the position in the backlog.Progress: ready for devReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it