Skip to content

Commit 477205d

Browse files
committed
Merge remote-tracking branch 'origin/2.3-develop' into graphql-679
2 parents 5d95e73 + bfa0fd4 commit 477205d

File tree

352 files changed

+7447
-2679
lines changed

Some content is hidden

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

352 files changed

+7447
-2679
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Magento 2 development team or community maintainers will review all issues a
1111
During the review we might require clarifications from the contributor.
1212
If there is no response from the contributor within two weeks, the pull request will be closed.
1313

14-
For more detialed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
14+
For more detailed information on contribution please read our [beginners guide](https://github.com/magento/magento2/wiki/Getting-Started).
1515

1616
## Contribution requirements
1717

app/code/Magento/AdminNotification/Model/Feed.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\AdminNotification\Model;
77

8+
use Magento\Framework\Escaper;
9+
use Magento\Framework\App\ObjectManager;
810
use Magento\Framework\Config\ConfigOptionsListConstants;
911

1012
/**
@@ -25,6 +27,11 @@ class Feed extends \Magento\Framework\Model\AbstractModel
2527

2628
const XML_LAST_UPDATE_PATH = 'system/adminnotification/last_update';
2729

30+
/**
31+
* @var Escaper
32+
*/
33+
private $escaper;
34+
2835
/**
2936
* Feed url
3037
*
@@ -77,6 +84,7 @@ class Feed extends \Magento\Framework\Model\AbstractModel
7784
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
7885
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
7986
* @param array $data
87+
* @param Escaper|null $escaper
8088
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8189
*/
8290
public function __construct(
@@ -90,21 +98,26 @@ public function __construct(
9098
\Magento\Framework\UrlInterface $urlBuilder,
9199
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
92100
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
93-
array $data = []
101+
array $data = [],
102+
Escaper $escaper = null
94103
) {
95104
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
96-
$this->_backendConfig = $backendConfig;
97-
$this->_inboxFactory = $inboxFactory;
98-
$this->curlFactory = $curlFactory;
105+
$this->_backendConfig = $backendConfig;
106+
$this->_inboxFactory = $inboxFactory;
107+
$this->curlFactory = $curlFactory;
99108
$this->_deploymentConfig = $deploymentConfig;
100-
$this->productMetadata = $productMetadata;
101-
$this->urlBuilder = $urlBuilder;
109+
$this->productMetadata = $productMetadata;
110+
$this->urlBuilder = $urlBuilder;
111+
$this->escaper = $escaper ?? ObjectManager::getInstance()->get(
112+
Escaper::class
113+
);
102114
}
103115

104116
/**
105117
* Init model
106118
*
107119
* @return void
120+
* phpcs:disable Magento2.CodeAnalysis.EmptyBlock
108121
*/
109122
protected function _construct()
110123
{
@@ -252,6 +265,6 @@ public function getFeedXml()
252265
*/
253266
private function escapeString(\SimpleXMLElement $data)
254267
{
255-
return htmlspecialchars((string)$data);
268+
return $this->escaper->escapeHtml((string)$data);
256269
}
257270
}

app/code/Magento/Backend/Test/Mftf/Section/AdminHeaderSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
<element name="adminUserAccountText" type="text" selector=".page-header .admin-user-account-text" />
1414
<!-- Legacy heading section. Mostly used for admin 404 and 403 pages -->
1515
<element name="pageHeading" type="text" selector=".page-content .page-heading"/>
16+
<!-- Used for page not found error -->
17+
<element name="pageNotFoundTitle" type="text" selector=".page-title span"/>
1618
</section>
1719
</sections>

app/code/Magento/Bundle/Test/Mftf/Test/AdminProductBundleCreationTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3232
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3333
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
34+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
35+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
3436
<actionGroup ref="logout" stepKey="logout"/>
3537
</after>
3638
<!-- go to bundle product creation page-->

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleProductDetailsTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
3333
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3434
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
35+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndexPage"/>
36+
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteAllProducts"/>
3537
<actionGroup ref="logout" stepKey="logout"/>
3638
</after>
3739
<!-- go to bundle product creation page-->

app/code/Magento/Bundle/view/frontend/templates/sales/order/creditmemo/items/renderer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
</td>
6868
<td class="col discount" data-th="<?= $block->escapeHtml(__('Discount Amount')) ?>">
6969
<?php if ($block->canShowPriceInfo($_item)) : ?>
70-
<?= $block->escapeHtml($block->getOrder()->formatPrice(-$_item->getDiscountAmount())) ?>
70+
<?= $block->escapeHtml($block->getOrder()->formatPrice(-$_item->getDiscountAmount()), ['span']) ?>
7171
<?php else : ?>
7272
&nbsp;
7373
<?php endif; ?>

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,18 @@
1212
*/
1313
namespace Magento\Catalog\Block\Adminhtml\Product;
1414

15+
use Magento\Framework\Escaper;
16+
17+
/**
18+
* Class Edit
19+
*/
1520
class Edit extends \Magento\Backend\Block\Widget
1621
{
22+
/**
23+
* @var Escaper
24+
*/
25+
private $escaper;
26+
1727
/**
1828
* @var string
1929
*/
@@ -47,6 +57,7 @@ class Edit extends \Magento\Backend\Block\Widget
4757
* @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory
4858
* @param \Magento\Framework\Registry $registry
4959
* @param \Magento\Catalog\Helper\Product $productHelper
60+
* @param Escaper $escaper
5061
* @param array $data
5162
*/
5263
public function __construct(
@@ -55,16 +66,20 @@ public function __construct(
5566
\Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory,
5667
\Magento\Framework\Registry $registry,
5768
\Magento\Catalog\Helper\Product $productHelper,
69+
Escaper $escaper,
5870
array $data = []
5971
) {
6072
$this->_productHelper = $productHelper;
6173
$this->_attributeSetFactory = $attributeSetFactory;
6274
$this->_coreRegistry = $registry;
6375
$this->jsonEncoder = $jsonEncoder;
76+
$this->escaper = $escaper;
6477
parent::__construct($context, $data);
6578
}
6679

6780
/**
81+
* Edit Product constructor
82+
*
6883
* @return void
6984
*/
7085
protected function _construct()
@@ -144,6 +159,8 @@ protected function _prepareLayout()
144159
}
145160

146161
/**
162+
* Retrieve back button html
163+
*
147164
* @return string
148165
*/
149166
public function getBackButtonHtml()
@@ -152,6 +169,8 @@ public function getBackButtonHtml()
152169
}
153170

154171
/**
172+
* Retrieve cancel button html
173+
*
155174
* @return string
156175
*/
157176
public function getCancelButtonHtml()
@@ -160,6 +179,8 @@ public function getCancelButtonHtml()
160179
}
161180

162181
/**
182+
* Retrieve save button html
183+
*
163184
* @return string
164185
*/
165186
public function getSaveButtonHtml()
@@ -168,6 +189,8 @@ public function getSaveButtonHtml()
168189
}
169190

170191
/**
192+
* Retrieve save and edit button html
193+
*
171194
* @return string
172195
*/
173196
public function getSaveAndEditButtonHtml()
@@ -176,6 +199,8 @@ public function getSaveAndEditButtonHtml()
176199
}
177200

178201
/**
202+
* Retrieve delete button html
203+
*
179204
* @return string
180205
*/
181206
public function getDeleteButtonHtml()
@@ -194,6 +219,8 @@ public function getSaveSplitButtonHtml()
194219
}
195220

196221
/**
222+
* Retrieve validation url
223+
*
197224
* @return string
198225
*/
199226
public function getValidationUrl()
@@ -202,6 +229,8 @@ public function getValidationUrl()
202229
}
203230

204231
/**
232+
* Retrieve save url
233+
*
205234
* @return string
206235
*/
207236
public function getSaveUrl()
@@ -210,6 +239,8 @@ public function getSaveUrl()
210239
}
211240

212241
/**
242+
* Retrieve save and continue url
243+
*
213244
* @return string
214245
*/
215246
public function getSaveAndContinueUrl()
@@ -221,6 +252,8 @@ public function getSaveAndContinueUrl()
221252
}
222253

223254
/**
255+
* Retrieve product id
256+
*
224257
* @return mixed
225258
*/
226259
public function getProductId()
@@ -229,6 +262,8 @@ public function getProductId()
229262
}
230263

231264
/**
265+
* Retrieve product set id
266+
*
232267
* @return mixed
233268
*/
234269
public function getProductSetId()
@@ -241,6 +276,8 @@ public function getProductSetId()
241276
}
242277

243278
/**
279+
* Retrieve duplicate url
280+
*
244281
* @return string
245282
*/
246283
public function getDuplicateUrl()
@@ -249,6 +286,8 @@ public function getDuplicateUrl()
249286
}
250287

251288
/**
289+
* Retrieve product header
290+
*
252291
* @deprecated 101.1.0
253292
* @return string
254293
*/
@@ -263,6 +302,8 @@ public function getHeader()
263302
}
264303

265304
/**
305+
* Get product attribute set name
306+
*
266307
* @return string
267308
*/
268309
public function getAttributeSetName()
@@ -275,11 +316,14 @@ public function getAttributeSetName()
275316
}
276317

277318
/**
319+
* Retrieve id of selected tab
320+
*
278321
* @return string
279322
*/
280323
public function getSelectedTabId()
281324
{
282-
return addslashes(htmlspecialchars($this->getRequest()->getParam('tab')));
325+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
326+
return addslashes($this->escaper->escapeHtml($this->getRequest()->getParam('tab')));
283327
}
284328

285329
/**
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminFillProductAttributePropertiesActionGroup">
11+
<arguments>
12+
<argument name="attributeName" type="string"/>
13+
<argument name="attributeType" type="string"/>
14+
</arguments>
15+
<fillField selector="{{AttributePropertiesSection.DefaultLabel}}" userInput="{{attributeName}}" stepKey="fillDefaultLabel"/>
16+
<selectOption selector="{{AttributePropertiesSection.InputType}}" userInput="{{attributeType}}" stepKey="selectInputType"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenAttributeSetByNameActionGroup">
11+
<arguments>
12+
<argument name="attributeSetName" type="string" defaultValue="Default"/>
13+
</arguments>
14+
<click selector="{{AdminProductAttributeSetGridSection.AttributeSetName(attributeSetName)}}" stepKey="chooseAttributeSet"/>
15+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminOpenAttributeSetGridPageActionGroup">
11+
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/>
12+
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/>
13+
</actionGroup>
14+
</actionGroups>

0 commit comments

Comments
 (0)