Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
milansimek opened this issue May 29, 2017 · 9 comments
Closed

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

milansimek opened this issue May 29, 2017 · 9 comments
Assignees
Labels
Event: MMNY17 Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@milansimek
Copy link

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>
@veloraven
Copy link
Contributor

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

@milansimek
Copy link
Author

Magento 2.x

@allanpaiste
Copy link

This was issue in both 2.0 and 2.1, we've been using patch to fix this => https://github.com/allanpaiste/magento2-patches/blob/master/Magento_Widget-fix-support-for-multiple-parameter-dependencies.patch

@magento-engcom-team magento-engcom-team added G1 Passed Progress: needs update Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed Progress: needs update labels Sep 13, 2017
@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Sep 21, 2017
@diazwatson
Copy link
Contributor

I'm working on it #SQUASHTOBERFEST

magento-team pushed a commit that referenced this issue Oct 19, 2017
…ters in widget.… #11495

 - Merge Pull Request #11495 from diazwatson/magento2:9783_MultipleDependsParametersNotAllowedInWidget
 - Merged commits:
   1. 84b0872
magento-team pushed a commit that referenced this issue Oct 19, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-81993

@okorshenko
Copy link
Contributor

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

@magento-engcom-team
Copy link
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.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 30, 2018
@milansimek
Copy link
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
Labels
Event: MMNY17 Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

7 participants