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

Parameter always required though disabled from depending parameter #7580

Closed
biolauri opened this issue Nov 26, 2016 · 1 comment
Closed

Parameter always required though disabled from depending parameter #7580

biolauri opened this issue Nov 26, 2016 · 1 comment
Labels
bug report Component: Cms Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@biolauri
Copy link

This is a reopening of #4672.

Preconditions

  1. Magento 2.1.2
  2. Custom widget installed and enabled:
    <?xml version="1.0" encoding="UTF-8"?>
    <widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Widget:etc/widget.xsd">
     <widget id="Test_DepPar">
     	<label translate="true">Test widget: depending parameters</label>
     	<description>Test depending and required parameters</description>
     	<parameters>
     		<parameter name="display" xsi:type="select" required="true" visible="true" sort_order="10" >
     			<label translate="true">Display other parameter</label>
     			<options>
     				<option name="true" value="true">
     					<label translate="true">Yes</label>
     				</option>
     				<option name="false" value="false">
     					<label translate="true">No</label>
     				</option>
     			</options>
     		</parameter>
     		<parameter name="other_parameter" xsi:type="text" required="true" visible="true" sort_order="20" >
     			<label translate="true">Other parameter</label>
     			<depends>
     				<parameter name="display" value="true" />
     			</depends>
     		</parameter>
     	</parameters>
     </widget>
    </widgets>

Steps to reproduce

  1. Insert new widget in CMS page via widget editor
  2. Select installed widget above (Test widget: depending parameters)
  3. Select No in parameter Display other parameter
  4. Insert widget

Expected result

  1. The widget gets inserted into the (WYSIWYG) editor
  2. Parameter other_parameter is not set (disabled by display based on <depends>[…]</depends> of other_parameter)

Actual result

  1. The widget will not get inserted (nothing happens)
  2. This is based on required="true", which is not overwritten by the dependency

So, I would appreciate a better function to determine whether a parameter is required or not: Not only based on the attribute required="true|false", but also according to the current state (deactivated based on dependency) of the parameter.

@magento-engcom-team magento-engcom-team added 2.1.x bug report Component: Cms Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 11, 2017
@magento-engcom-team
Copy link
Contributor

@biolauri, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Cms Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

3 participants