Skip to content

Commit 13f4ad1

Browse files
committed
MAGETWO-96192: Products with "Less Than", "Greater Than", "Less Than Or Equal", "Greater Than Or Equal" condition returns error on storefront
- Added < and > to list of encoded characters
1 parent d7012b2 commit 13f4ad1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
<element name="AddParam" type="button" selector=".rule-param-add"/>
9999
<element name="ConditionsDropdown" type="select" selector="#conditions__1__new_child"/>
100100
<element name="RuleParam" type="button" selector="//a[text()='...']"/>
101+
<element name="RuleParamSelect" type="select" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//select" parameterized="true"/>
102+
<element name="RuleParamInput" type="input" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//input" parameterized="true"/>
103+
<element name="RuleParamLabel" type="input" selector="//ul[contains(@class,'rule-param-children')]/li[{{arg1}}]//*[contains(@class,'rule-param')][{{arg2}}]//a" parameterized="true"/>
101104
<element name="Chooser" type="button" selector="//img[@title='Open Chooser']"/>
102105
<element name="PageSize" type="input" selector="input[name='parameters[page_size]']"/>
103106
<element name="ProductAttribute" type="multiselect" selector="select[name='parameters[show_attributes][]']" />

app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,29 @@
5757
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam" />
5858
<waitForElementVisible selector="{{WidgetSection.Chooser}}" stepKey="waitForElement" />
5959
<click selector="{{WidgetSection.Chooser}}" stepKey="clickChooser" />
60-
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear3" />
60+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear4" />
6161
<click selector="{{WidgetSection.PreCreateCategory('$$createPreReqCategory.name$$')}}" stepKey="selectPreCategory" />
62+
63+
<!-- Test that the "<" operand functions correctly -->
64+
<click selector="{{WidgetSection.AddParam}}" stepKey="clickAddParamBtn2" />
65+
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}" stepKey="waitForDropdownVisible2"/>
66+
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="Price" stepKey="selectPriceCondition"/>
67+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear3"/>
68+
<click selector="{{WidgetSection.RuleParamLabel('2','1')}}" stepKey="clickOperatorLabel"/>
69+
<selectOption selector="{{WidgetSection.RuleParamSelect('2','1')}}" userInput="&lt;" stepKey="selectLessThanCondition"/>
70+
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam2"/>
71+
<fillField selector="{{WidgetSection.RuleParamInput('2','2')}}" userInput="125" stepKey="fillMaxPrice"/>
72+
73+
<!-- Test that the ">" operand functions correctly -->
74+
<click selector="{{WidgetSection.AddParam}}" stepKey="clickAddParamBtn3" />
75+
<waitForElementVisible selector="{{WidgetSection.ConditionsDropdown}}" stepKey="waitForDropdownVisible3"/>
76+
<selectOption selector="{{WidgetSection.ConditionsDropdown}}" userInput="Price" stepKey="selectPriceCondition2"/>
77+
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskDisappear5"/>
78+
<click selector="{{WidgetSection.RuleParamLabel('3','1')}}" stepKey="clickOperatorLabel2"/>
79+
<selectOption selector="{{WidgetSection.RuleParamSelect('3','1')}}" userInput="&gt;" stepKey="selectLessThanCondition2"/>
80+
<click selector="{{WidgetSection.RuleParam}}" stepKey="clickRuleParam3"/>
81+
<fillField selector="{{WidgetSection.RuleParamInput('3','2')}}" userInput="1" stepKey="fillMinPrice"/>
82+
6283
<click selector="{{WidgetSection.InsertWidget}}" stepKey="clickInsertWidget" />
6384
<waitForPageLoad stepKey="wait6" />
6485
<scrollTo selector="{{CmsNewPagePageSeoSection.header}}" stepKey="scrollToSearchEngineTab" />

lib/internal/Magento/Framework/Data/Wysiwyg/Normalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
*/
1111
class Normalizer
1212
{
13-
1413
const WYSIWYG_RESERVED_CHARACTERS_REPLACEMENT_MAP = [
1514
'{' => '^[',
1615
'}' => '^]',
1716
'"' => '`',
1817
'\\' => '|',
18+
'<' => '^(',
19+
'>' => '^)'
1920
];
2021

2122
/**

0 commit comments

Comments
 (0)