-
Notifications
You must be signed in to change notification settings - Fork 9.4k
MAGETWO-75743: Fix for #9783 Multiple <depends> parameters in widget.… #11495
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
MAGETWO-75743: Fix for #9783 Multiple <depends> parameters in widget.… #11495
Conversation
…xml not allowed
@diazwatson Now there are no fatal errors, but multiple depends node does not work as expected.
Expected Result:
Actual Result:
NotesThe script is generated correctly, but does not seem to work as this PR expects:
|
I'll check |
Are you sure you have to modify the Javascript for this? I have been using just the XML fix I've proposed in my initial bug report, which seems to do the trick. <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> The main difference I see here compared to your pull request is the minOccurs="1". Not sure if that matters though |
@milansimek the PR does not change the javascript; just point out that javascript generates correctly, but it does not work as expected. Try to follow my steps, you'll see that it's not enough to change the xml. |
@vrann Ah yes, sorry about that. I'm a bit tired. I'll check to see how I did it in our custom extension and will report back here |
@vrann I just tested in Magento 2.1.6: Works fine when just using the XML fix I proposed. Should work also in 2.2 I guess but if you want I can double check for you. Please note that I did not apply the changes from the pull request to the following file when testing: |
@milansimek thanks, re-tested again and it works as expected |
@vrann should I revert changes in |
…ters in widget.… #11495
Description
Allow multiple depends parameters to be allowed in
widget.xml
.Fixed Issues (if relevant)
Manual testing scenarios
widget.xml
in your custom module and add a widget,widgets>widget>parameters
with a<depends>
tag, making it depend on the value of two other parameters as follows:Expected result
The field should be shown only when both dependencies are met
Contribution checklist