Skip to content

Commit e318e6f

Browse files
committed
Merge branches 'MC-4428' and 'mtf-eol' of https://github.com/magento-pangolin/magento2ce into MC-4428
2 parents 1936cfa + de17226 commit e318e6f

File tree

443 files changed

+13465
-6438
lines changed

Some content is hidden

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

443 files changed

+13465
-6438
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ atlassian*
4848
/pub/media/import/*
4949
!/pub/media/import/.htaccess
5050
/pub/media/logo/*
51+
/pub/media/custom_options/*
52+
!/pub/media/custom_options/.htaccess
5153
/pub/media/theme/*
5254
/pub/media/theme_customization/*
5355
!/pub/media/theme_customization/.htaccess

.htaccess

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#AddType x-mapp-php5 .php
2828
#AddHandler x-mapp-php5 .php
2929

30+
############################################
31+
## enable usage of methods arguments in backtrace
32+
33+
SetEnv MAGE_DEBUG_SHOW_ARGS 1
34+
3035
############################################
3136
## default index file
3237

@@ -364,6 +369,15 @@
364369
Require all denied
365370
</IfVersion>
366371
</Files>
372+
<Files .user.ini>
373+
<IfVersion < 2.4>
374+
order allow,deny
375+
deny from all
376+
</IfVersion>
377+
<IfVersion >= 2.4>
378+
Require all denied
379+
</IfVersion>
380+
</Files>
367381

368382
# For 404s and 403s that aren't handled by the application, show plain 404 response
369383
ErrorDocument 404 /pub/errors/404.php

.htaccess.sample

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
#AddType x-mapp-php5 .php
2828
#AddHandler x-mapp-php5 .php
2929

30+
############################################
31+
## enable usage of methods arguments in backtrace
32+
33+
SetEnv MAGE_DEBUG_SHOW_ARGS 1
34+
3035
############################################
3136
## default index file
3237

@@ -341,6 +346,15 @@
341346
Require all denied
342347
</IfVersion>
343348
</Files>
349+
<Files .user.ini>
350+
<IfVersion < 2.4>
351+
order allow,deny
352+
deny from all
353+
</IfVersion>
354+
<IfVersion >= 2.4>
355+
Require all denied
356+
</IfVersion>
357+
</Files>
344358

345359
# For 404s and 403s that aren't handled by the application, show plain 404 response
346360
ErrorDocument 404 /pub/errors/404.php

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* Environment initialization
99
*/
1010
error_reporting(E_ALL);
11+
stream_wrapper_unregister('phar');
1112
#ini_set('display_errors', 1);
1213

1314
/* PHP version validation */

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
namespace Magento\AdminNotification\Block\Grid\Renderer;
1010

11+
/**
12+
* Renderer class for action in the admin notifications grid
13+
*
14+
* @package Magento\AdminNotification\Block\Grid\Renderer
15+
*/
1116
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
1217
{
1318
/**
@@ -37,7 +42,9 @@ public function __construct(
3742
*/
3843
public function render(\Magento\Framework\DataObject $row)
3944
{
40-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
45+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' .
46+
$this->escapeUrl($row->getUrl())
47+
. '">' .
4148
__('Read Details') . '</a>' : '';
4249

4350
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/AdditionalCommentTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ protected function setUp()
3939
->setMethods(['getComment', 'getLabel'])
4040
->disableOriginalConstructor()
4141
->getMock();
42+
43+
$objectManager = new ObjectManager($this);
44+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
45+
$reflection = new \ReflectionClass($this->abstractElementMock);
46+
$reflection_property = $reflection->getProperty('_escaper');
47+
$reflection_property->setAccessible(true);
48+
$reflection_property->setValue($this->abstractElementMock, $escaper);
49+
50+
$this->abstractElementMock->setEscaper($escaper);
4251
$this->contextMock = $this->getMockBuilder(Context::class)
4352
->disableOriginalConstructor()
4453
->getMock();

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/CollectionTimeLabelTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ protected function setUp()
4646
->setMethods(['getComment'])
4747
->disableOriginalConstructor()
4848
->getMock();
49+
50+
$objectManager = new ObjectManager($this);
51+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
52+
$reflection = new \ReflectionClass($this->abstractElementMock);
53+
$reflection_property = $reflection->getProperty('_escaper');
54+
$reflection_property->setAccessible(true);
55+
$reflection_property->setValue($this->abstractElementMock, $escaper);
56+
4957
$this->contextMock = $this->getMockBuilder(Context::class)
5058
->setMethods(['getLocaleDate'])
5159
->disableOriginalConstructor()

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/SubscriptionStatusLabelTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ protected function setUp()
5151
->setMethods(['getComment'])
5252
->disableOriginalConstructor()
5353
->getMock();
54+
55+
$objectManager = new ObjectManager($this);
56+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
57+
$reflection = new \ReflectionClass($this->abstractElementMock);
58+
$reflection_property = $reflection->getProperty('_escaper');
59+
$reflection_property->setAccessible(true);
60+
$reflection_property->setValue($this->abstractElementMock, $escaper);
61+
5462
$this->formMock = $this->getMockBuilder(Form::class)
5563
->disableOriginalConstructor()
5664
->getMock();

app/code/Magento/Analytics/Test/Unit/Block/Adminhtml/System/Config/VerticalTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ protected function setUp()
3939
->setMethods(['getComment', 'getLabel', 'getHint'])
4040
->disableOriginalConstructor()
4141
->getMock();
42+
43+
$objectManager = new ObjectManager($this);
44+
$escaper = $objectManager->getObject(\Magento\Framework\Escaper::class);
45+
$reflection = new \ReflectionClass($this->abstractElementMock);
46+
$reflection_property = $reflection->getProperty('_escaper');
47+
$reflection_property->setAccessible(true);
48+
$reflection_property->setValue($this->abstractElementMock, $escaper);
49+
4250
$this->contextMock = $this->getMockBuilder(Context::class)
4351
->disableOriginalConstructor()
4452
->getMock();

app/code/Magento/Backend/Block/Widget/Form/Container.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class Container extends \Magento\Backend\Block\Widget\Container
5656
protected $_template = 'Magento_Backend::widget/form/container.phtml';
5757

5858
/**
59+
* Initialize form.
60+
*
5961
* @return void
6062
*/
6163
protected function _construct()
@@ -83,7 +85,7 @@ protected function _construct()
8385
-1
8486
);
8587

86-
$objId = $this->getRequest()->getParam($this->_objectId);
88+
$objId = (int)$this->getRequest()->getParam($this->_objectId);
8789

8890
if (!empty($objId)) {
8991
$this->addButton(
@@ -151,11 +153,13 @@ public function getBackUrl()
151153
}
152154

153155
/**
156+
* Get URL for delete button.
157+
*
154158
* @return string
155159
*/
156160
public function getDeleteUrl()
157161
{
158-
return $this->getUrl('*/*/delete', [$this->_objectId => $this->getRequest()->getParam($this->_objectId)]);
162+
return $this->getUrl('*/*/delete', [$this->_objectId => (int)$this->getRequest()->getParam($this->_objectId)]);
159163
}
160164

161165
/**
@@ -183,6 +187,8 @@ public function getFormActionUrl()
183187
}
184188

185189
/**
190+
* Get form HTML.
191+
*
186192
* @return string
187193
*/
188194
public function getFormHtml()
@@ -192,6 +198,8 @@ public function getFormHtml()
192198
}
193199

194200
/**
201+
* Get form init scripts.
202+
*
195203
* @return string
196204
*/
197205
public function getFormInitScripts()
@@ -203,6 +211,8 @@ public function getFormInitScripts()
203211
}
204212

205213
/**
214+
* Get form scripts.
215+
*
206216
* @return string
207217
*/
208218
public function getFormScripts()
@@ -214,6 +224,8 @@ public function getFormScripts()
214224
}
215225

216226
/**
227+
* Get header width.
228+
*
217229
* @return string
218230
*/
219231
public function getHeaderWidth()
@@ -222,6 +234,8 @@ public function getHeaderWidth()
222234
}
223235

224236
/**
237+
* Get header css class.
238+
*
225239
* @return string
226240
*/
227241
public function getHeaderCssClass()
@@ -230,6 +244,8 @@ public function getHeaderCssClass()
230244
}
231245

232246
/**
247+
* Get header HTML.
248+
*
233249
* @return string
234250
*/
235251
public function getHeaderHtml()

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,25 +282,23 @@ public function getGridIdsJson()
282282
if (!$this->getUseSelectAll()) {
283283
return '';
284284
}
285-
/** @var \Magento\Framework\Data\Collection $allIdsCollection */
286-
$allIdsCollection = clone $this->getParentBlock()->getCollection();
287285

288-
if ($this->getMassactionIdField()) {
289-
$massActionIdField = $this->getMassactionIdField();
286+
/** @var \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection $collection */
287+
$collection = clone $this->getParentBlock()->getCollection();
288+
289+
if ($collection instanceof AbstractDb) {
290+
$idsSelect = clone $collection->getSelect();
291+
$idsSelect->reset(\Magento\Framework\DB\Select::ORDER);
292+
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_COUNT);
293+
$idsSelect->reset(\Magento\Framework\DB\Select::LIMIT_OFFSET);
294+
$idsSelect->reset(\Magento\Framework\DB\Select::COLUMNS);
295+
$idsSelect->columns($this->getMassactionIdField(), 'main_table');
296+
$idList = $collection->getConnection()->fetchCol($idsSelect);
290297
} else {
291-
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
298+
$idList = $collection->setPageSize(0)->getColumnValues($this->getMassactionIdField());
292299
}
293300

294-
if ($allIdsCollection instanceof AbstractDb) {
295-
$allIdsCollection->getSelect()->limit();
296-
$allIdsCollection->clear();
297-
}
298-
299-
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
300-
if (!empty($gridIds)) {
301-
return join(",", $gridIds);
302-
}
303-
return '';
301+
return implode(',', $idList);
304302
}
305303

306304
/**

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/MassactionTest.php

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -269,62 +269,6 @@ public function testGetGridIdsJsonWithoutUseSelectAll()
269269
$this->assertEmpty($this->_block->getGridIdsJson());
270270
}
271271

272-
/**
273-
* @param array $items
274-
* @param string $result
275-
*
276-
* @dataProvider dataProviderGetGridIdsJsonWithUseSelectAll
277-
*/
278-
public function testGetGridIdsJsonWithUseSelectAll(array $items, $result)
279-
{
280-
$this->_block->setUseSelectAll(true);
281-
282-
if ($this->_block->getMassactionIdField()) {
283-
$massActionIdField = $this->_block->getMassactionIdField();
284-
} else {
285-
$massActionIdField = $this->_block->getParentBlock()->getMassactionIdField();
286-
}
287-
288-
$collectionMock = $this->getMockBuilder(\Magento\Framework\Data\Collection::class)
289-
->disableOriginalConstructor()
290-
->getMock();
291-
292-
$this->_gridMock->expects($this->once())
293-
->method('getCollection')
294-
->willReturn($collectionMock);
295-
$collectionMock->expects($this->once())
296-
->method('setPageSize')
297-
->with(0)
298-
->willReturnSelf();
299-
$collectionMock->expects($this->once())
300-
->method('getColumnValues')
301-
->with($massActionIdField)
302-
->willReturn($items);
303-
304-
$this->assertEquals($result, $this->_block->getGridIdsJson());
305-
}
306-
307-
/**
308-
* @return array
309-
*/
310-
public function dataProviderGetGridIdsJsonWithUseSelectAll()
311-
{
312-
return [
313-
[
314-
[],
315-
'',
316-
],
317-
[
318-
[1],
319-
'1',
320-
],
321-
[
322-
[1, 2, 3],
323-
'1,2,3',
324-
],
325-
];
326-
}
327-
328272
/**
329273
* @param string $itemId
330274
* @param array|\Magento\Framework\DataObject $item
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontSelectBundleProductDropDownOptionActionGroup">
12+
<arguments>
13+
<argument name="productName" type="string"/>
14+
</arguments>
15+
<click selector="{{StorefrontBundleProductActionSection.dropdownSelectOption}}" stepKey="clickOnSelectOption"/>
16+
<click selector="{{StorefrontBundleProductActionSection.dropdownProductSelection(productName)}}" stepKey="selectProduct"/>
17+
</actionGroup>
18+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup">
12+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="waitForCustomizeAndAddToCartButton"/>
13+
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
14+
<waitForPageLoad stepKey="waitForPageLoad"/>
15+
</actionGroup>
16+
</actionGroups>

0 commit comments

Comments
 (0)