Skip to content

Commit 181d264

Browse files
[Magento Community Engineering] Community Contributions - 2.3-develop
- merged latest code from mainline branch
2 parents dea5411 + 6e5e383 commit 181d264

File tree

44 files changed

+928
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+928
-107
lines changed

app/code/Magento/Backend/Model/Menu/Item/Validator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
namespace Magento\Backend\Model\Menu\Item;
77

88
/**
9+
* Class Validator
10+
*
11+
* @package Magento\Backend\Model\Menu\Item
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -49,7 +52,7 @@ public function __construct()
4952

5053
$attributeValidator = new \Zend_Validate();
5154
$attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
52-
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_]+$/'));
55+
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/'));
5356

5457
$textValidator = new \Zend_Validate_StringLength(['min' => 3, 'max' => 50]);
5558

@@ -101,6 +104,7 @@ private function checkMenuItemIsRemoved($data)
101104

102105
/**
103106
* Check that menu item contains all required data
107+
*
104108
* @param array $data
105109
*
106110
* @throws \BadMethodCallException

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
' resource="Test_Value::value"/></menu></config>',
1111
[
1212
"Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
13-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
13+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
1414
"Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
1515
],
1616
],
@@ -20,7 +20,7 @@
2020
'resource="Test_Value::value"/></menu></config>',
2121
[
2222
"Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " .
23-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
23+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
2424
"Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
2525
],
2626
],
@@ -31,7 +31,7 @@
3131
'</menu></config>',
3232
[
3333
"Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " .
34-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
34+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
3535
"Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " .
3636
"type 'typeAction'.\nLine: 1\n"
3737
],
@@ -452,7 +452,7 @@
452452
'<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>',
453453
[
454454
"Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
455-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
455+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
456456
"Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
457457
],
458458
],
@@ -462,7 +462,7 @@
462462
'resource="Test_Value::value"/></menu></config>',
463463
[
464464
"Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " .
465-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
465+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
466466
"Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
467467
],
468468
],
@@ -471,7 +471,7 @@
471471
'id="Test_Value::some_value"/></menu></config>',
472472
[
473473
"Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " .
474-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
474+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
475475
"Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" .
476476
" type 'typeAction'.\nLine: 1\n"
477477
],

app/code/Magento/Backend/etc/menu.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</xs:documentation>
101101
</xs:annotation>
102102
<xs:restriction base="xs:string">
103-
<xs:pattern value="[a-zA-Z0-9/_]{3,}" />
103+
<xs:pattern value="[a-zA-Z0-9/_\-]{3,}" />
104104
</xs:restriction>
105105
</xs:simpleType>
106106

app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private function checkUniqueOption(DataObject $response, array $options = null)
252252
private function checkEmptyOption(DataObject $response, array $optionsForCheck = null)
253253
{
254254
foreach ($optionsForCheck as $optionValues) {
255-
if (isset($optionValues[0]) && $optionValues[0] == '') {
255+
if (isset($optionValues[0]) && trim($optionValues[0]) == '') {
256256
$this->setMessageToResponse($response, [__("The value of Admin scope can't be empty.")]);
257257
$response->setError(true);
258258
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontForthLevelCategoryTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Category"/>
15+
<title value="Storefront forth level category test"/>
16+
<description value="When the submenu was created in the third stage follow, the submenu works"/>
17+
<severity value="MAJOR"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleSubCategory" stepKey="category1"/>
22+
<createData entity="SubCategoryWithParent" stepKey="category2">
23+
<requiredEntity createDataKey="category1"/>
24+
</createData>
25+
<createData entity="SubCategoryWithParent" stepKey="category3">
26+
<requiredEntity createDataKey="category2"/>
27+
</createData>
28+
<createData entity="SubCategoryWithParent" stepKey="category4">
29+
<requiredEntity createDataKey="category3"/>
30+
</createData>
31+
</before>
32+
<after>
33+
<deleteData createDataKey="category4" stepKey="deleteCategory4"/>
34+
<deleteData createDataKey="category3" stepKey="deleteCategory3"/>
35+
<deleteData createDataKey="category2" stepKey="deleteCategory2"/>
36+
<deleteData createDataKey="category1" stepKey="deleteCategory1"/>
37+
</after>
38+
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/>
39+
<moveMouseOver
40+
selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category1.name$$)}}"
41+
stepKey="hoverCategoryLevelOne"/>
42+
<moveMouseOver
43+
selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category2.name$$)}}"
44+
stepKey="hoverCategoryLevelTwo"/>
45+
<moveMouseOver
46+
selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category3.name$$)}}"
47+
stepKey="hoverCategoryLevelThree"/>
48+
<moveMouseOver
49+
selector="{{StorefrontHeaderSection.NavigationCategoryByName($$category4.name$$)}}"
50+
stepKey="hoverCategoryLevelFour"/>
51+
</test>
52+
</tests>

0 commit comments

Comments
 (0)