Repository navigation
Multiple <depends> parameters in widget.xml not allowed #9783
Copy link
Copy link
Closed
Labels
Event: MMNY17Fixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions
- Install Magento 2.x
- Create custom module
Steps to reproduce
- Create a widget.xml in your custom module and add a widget
- Create a parameter (field) inside parent tag
widgets>widget>parameterswith 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
- The field should be shown only when both dependencies are met
Actual result
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>Metadata
Metadata
Assignees
Labels
Event: MMNY17Fixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release

Activity
veloraven commentedon Jul 5, 2017
@milansimek thank you for your report.
Please identify which version of Magento you are running.
milansimek commentedon Jul 5, 2017
Magento 2.x
allanpaiste commentedon Jul 13, 2017
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 commentedon Sep 21, 2017
@milansimek, thank you for your report.
We've created internal ticket(s) MAGETWO-75743 to track progress on the issue.
6 remaining items
diazwatson commentedon Oct 16, 2017
I'm working on it #SQUASHTOBERFEST
MAGETWO-81993: MAGETWO-75743: Fix for #9783 Multiple <depends> parame…
MAGETWO-81993: MAGETWO-75743: Fix for #9783 Multiple <depends> parame…
magento-team commentedon Oct 19, 2017
Internal ticket to track issue progress: MAGETWO-81993
okorshenko commentedon Nov 1, 2017
The issue has been fixed and delivered to 2.2-develop branch. Will be available in 2.2.2 release
magento-engcom-team commentedon Jan 30, 2018
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.
milansimek commentedon Jan 31, 2018
@magento-engcom-team Great to hear so!
⏫ Forwardport of magento#11495 to 2.3-develop branch
Merge forwardport of magento#11495 to 2.3-develop branch
🔃 [EngCom] Public Pull Requests - 2.3-develop