magento2: Depending from multiselect in backend is broken

Preconditions (*)

  1. Magento ^2.2 (and probably earlier)

Steps to reproduce (*)

  1. Create a module with an etc/adminhtml/system.xml file
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="general">
            <group id="test" showInStore="1" showInWebsite="1" showInDefault="1" type="text" sortOrder="999">
                <label>Proof of concept</label>
                <field id="multiselect_id" translate="label" type="multiselect" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
                    <label>multiselect_id</label>
                    <source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
                </field>
                <field id="brand_attribute" type="text" sortOrder="3" showInStore="1" showInWebsite="1" showInDefault="1" translate="label,comment">
                    <label>Brand attribute</label>
                    <depends>
                        <field id="multiselect_id" separator=",">processing</field>
                    </depends>
                </field>
            </group>
        </section>
    </system>
</config>
  1. Select all the options

Expected result (*)

  1. The depending field should appear and become editable

Actual result (*)

  1. The field remains hidden until one unselects all options preceding the one one depends from proof

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • 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”.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Hello @bjornsnoen,

Thank you for the report and collaboration1

Verified this issue on 2.4-develop. When custom fields are added which is dependent on a specific value in multiselect, selecting all the options should make the field visible.

Please take a look at the screencast below: Screen.Recording.2024-03-08.at.2.18.01.PM.mov

Here we can see selecting all the options should have revealed the field. Hence confirming the issue.

Please find the attached module used to reproduce this issue. FieldVendor.zip

Thank you.

Hello! Glad to see this issue is now being looked into. I have not worked on magento in a few years at this point and am not set up to do any follow-up, but again I’m glad it’s being looked into. No need to tag me in any further updates.