Skip to content

Multiple <depends> parameters in widget.xml not allowed #9783

Closed

Description

@milansimek

Preconditions

  1. Install Magento 2.x
  2. Create custom module

Steps to reproduce

  1. Create a widget.xml in your custom module and add a widget
  2. Create a parameter (field) inside parent tag widgets>widget>parameters with a <depends> tag, making it depend on the value of two other parameters as follows:
<parameter name="myfield" xsi:type="text" required="true" visible="true">
      <label translate="true">Example</label>
      <depends>
          <parameter name="dependency_one" value="1"/>
          <parameter name="dependency_two" value="1"/>
      </depends>
</parameter>

Expected result

  1. The field should be shown only when both dependencies are met

Actual result

image

Way to fix

Update magento/module-widget/etc/widget.xsd and magento/module-widget/etc/widget_file.xsd

In the bottom of the files change this:

    <xs:complexType name="dependsType">
        <xs:annotation>
            <xs:documentation>List of parameters this parameter depends on.</xs:documentation>
        </xs:annotation>
        <xs:all>
            <xs:element name="parameter" type="dependsParameterType" />
        </xs:all>
    </xs:complexType>

Into this:

    <xs:complexType name="dependsType">
        <xs:annotation>
            <xs:documentation>List of parameters this parameter depends on.</xs:documentation>
        </xs:annotation>
        <xs:sequence maxOccurs="unbounded" minOccurs="1">
            <xs:element name="parameter" type="dependsParameterType" />
        </xs:sequence>
    </xs:complexType>

Activity

  1. veloraven commented on Jul 5, 2017

    @veloraven
    Contributor

    @milansimek thank you for your report.
    Please identify which version of Magento you are running.

  2. milansimek commented on Jul 5, 2017

    @milansimek
    Author

    Magento 2.x

  3. allanpaiste commented on Jul 13, 2017

    @allanpaiste
  4. magento-engcom-team commented on Sep 21, 2017

    @magento-engcom-team
    Contributor

    @milansimek, thank you for your report.
    We've created internal ticket(s) MAGETWO-75743 to track progress on the issue.

  5. 6 remaining items

  6. diazwatson commented on Oct 16, 2017

    @diazwatson
    Contributor

    I'm working on it #SQUASHTOBERFEST

  7. added 2 commits that reference this issue on Oct 19, 2017
  8. magento-team commented on Oct 19, 2017

    @magento-team
    Contributor

    Internal ticket to track issue progress: MAGETWO-81993

  9. okorshenko commented on Nov 1, 2017

    @okorshenko
    Contributor

    The issue has been fixed and delivered to 2.2-develop branch. Will be available in 2.2.2 release

  10. magento-engcom-team commented on Jan 30, 2018

    @magento-engcom-team
    Contributor

    Hi @milansimek. Thank you for your report.
    The issue has been fixed in magento-engcom/magento2ce#1283 by @magento-engcom-team in 2.3-develop branch
    Related commit(s):

    The fix will be available with the upcoming patch release.

  11. milansimek commented on Jan 31, 2018

    @milansimek
    Author

    @magento-engcom-team Great to hear so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Event: MMNY17Fixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions