Skip to content

Commit 20dbe08

Browse files
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into EPAM-PR-31
2 parents a51c724 + d3203b0 commit 20dbe08

File tree

51 files changed

+719
-133
lines changed

Some content is hidden

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

51 files changed

+719
-133
lines changed

app/code/Magento/Backend/Controller/Adminhtml/Dashboard/RefreshStatistics.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66

77
namespace Magento\Backend\Controller\Adminhtml\Dashboard;
88

9-
class RefreshStatistics extends \Magento\Reports\Controller\Adminhtml\Report\Statistics
9+
use Magento\Framework\App\Action\HttpPostActionInterface;
10+
use Magento\Reports\Controller\Adminhtml\Report\Statistics;
11+
12+
/**
13+
* Refresh Dashboard statistics action.
14+
*/
15+
class RefreshStatistics extends Statistics implements HttpPostActionInterface
1016
{
1117
/**
1218
* @param \Magento\Backend\App\Action\Context $context
@@ -25,6 +31,8 @@ public function __construct(
2531
}
2632

2733
/**
34+
* Refresh statistics.
35+
*
2836
* @return \Magento\Backend\Model\View\Result\Redirect
2937
*/
3038
public function execute()

app/code/Magento/CatalogImportExport/Model/Import/Product/Option.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ protected function _initMessageTemplates()
431431
);
432432
$this->_productEntity->addMessageTemplate(
433433
self::ERROR_INVALID_TYPE,
434-
__('Value for \'type\' sub attribute in \'custom_options\' attribute contains incorrect value, acceptable values are: \'dropdown\', \'checkbox\'')
434+
__(
435+
'Value for \'type\' sub attribute in \'custom_options\' attribute contains incorrect value, acceptable values are: %1',
436+
'\''.implode('\', \'', array_keys($this->_specificTypes)).'\''
437+
)
435438
);
436439
$this->_productEntity->addMessageTemplate(self::ERROR_EMPTY_TITLE, __('Please enter a value for title.'));
437440
$this->_productEntity->addMessageTemplate(
@@ -629,7 +632,7 @@ public function validateAmbiguousData()
629632
$this->_addRowsErrors(self::ERROR_AMBIGUOUS_NEW_NAMES, $errorRows);
630633
return false;
631634
}
632-
if ($this->getBehavior() == \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND) {
635+
if ($this->getBehavior() == Import::BEHAVIOR_APPEND) {
633636
$errorRows = $this->_findOldOptionsWithTheSameTitles();
634637
if ($errorRows) {
635638
$this->_addRowsErrors(self::ERROR_AMBIGUOUS_OLD_NAMES, $errorRows);
@@ -967,11 +970,10 @@ public function validateRow(array $rowData, $rowNumber)
967970
return false;
968971
}
969972
}
970-
return true;
971973
}
972974
}
973975

974-
return false;
976+
return true;
975977
}
976978

977979
/**
@@ -1381,7 +1383,7 @@ private function setLastOptionTitle(array &$titles) : void
13811383
*/
13821384
private function removeExistingOptions(array $products, array $optionsToRemove): void
13831385
{
1384-
if ($this->getBehavior() != \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND) {
1386+
if ($this->getBehavior() != Import::BEHAVIOR_APPEND) {
13851387
$this->_deleteEntities(array_keys($products));
13861388
} elseif (!empty($optionsToRemove)) {
13871389
// Remove options for products with empty "custom_options" row
@@ -2108,7 +2110,7 @@ private function savePreparedCustomOptions(
21082110
array $types
21092111
): void {
21102112
if ($this->_isReadyForSaving($options, $titles, $types['values'])) {
2111-
if ($this->getBehavior() == \Magento\ImportExport\Model\Import::BEHAVIOR_APPEND) {
2113+
if ($this->getBehavior() == Import::BEHAVIOR_APPEND) {
21122114
$this->_compareOptionsWithExisting($options, $titles, $prices, $types['values']);
21132115
$this->restoreOriginalOptionTypeIds($types['values'], $types['prices'], $types['titles']);
21142116
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/Type/OptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public function testValidateRowNoCustomOption()
702702
{
703703
$rowData = include __DIR__ . '/_files/row_data_no_custom_option.php';
704704
$this->_bypassModelMethodGetMultiRowFormat($rowData);
705-
$this->assertFalse($this->modelMock->validateRow($rowData, 0));
705+
$this->assertTrue($this->modelMock->validateRow($rowData, 0));
706706
}
707707

708708
/**

app/code/Magento/CatalogSearch/Model/ResourceModel/Advanced/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*
2222
* This collection should be refactored to not have dependencies on MySQL-specific implementation.
2323
*
24+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2425
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2526
* @api
2627
* @since 100.0.2
@@ -296,7 +297,7 @@ private function getSearchCriteriaBuilder()
296297
}
297298

298299
/**
299-
* Get fielter builder.
300+
* Get filter builder.
300301
*
301302
* @return FilterBuilder
302303
*/

app/code/Magento/Checkout/view/frontend/web/template/minicart/content.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
</div>
9898
</div>
9999

100-
<div id="minicart-widgets" class="minicart-widgets">
100+
<div id="minicart-widgets" class="minicart-widgets" if="getRegion('promotion').length">
101101
<each args="getRegion('promotion')" render=""/>
102102
</div>
103103
</div>

app/code/Magento/Cms/view/adminhtml/templates/browser/content/files.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $_height = $block->getImagesHeight();
2121
data-size="<?= $block->escapeHtmlAttr($file->getSize()) ?>"
2222
data-mime-type="<?= $block->escapeHtmlAttr($file->getMimeType()) ?>"
2323
>
24-
<p class="nm" style="height:<?= $block->escapeHtmlAttr($_height) ?>px;width:<?= $block->escapeHtmlAttr($_width) ?>px;">
24+
<p class="nm" style="height:<?= $block->escapeHtmlAttr($_height) ?>px;">
2525
<?php if ($block->getFileThumbUrl($file)):?>
2626
<img src="<?= $block->escapeHtmlAttr($block->getFileThumbUrl($file)) ?>" alt="<?= $block->escapeHtmlAttr($block->getFileName($file)) ?>"/>
2727
<?php endif; ?>

app/code/Magento/Customer/Block/Adminhtml/Edit/DeleteButton.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/**
1212
* Class DeleteButton
13+
*
1314
* @package Magento\Customer\Block\Adminhtml\Edit
1415
*/
1516
class DeleteButton extends GenericButton implements ButtonProviderInterface
@@ -36,6 +37,8 @@ public function __construct(
3637
}
3738

3839
/**
40+
* Get button data.
41+
*
3942
* @return array
4043
*/
4144
public function getButtonData()
@@ -53,12 +56,15 @@ public function getButtonData()
5356
],
5457
'on_click' => '',
5558
'sort_order' => 20,
59+
'aclResource' => 'Magento_Customer::delete',
5660
];
5761
}
5862
return $data;
5963
}
6064

6165
/**
66+
* Get delete url.
67+
*
6268
* @return string
6369
*/
6470
public function getDeleteUrl()

app/code/Magento/Customer/Block/Adminhtml/Edit/InvalidateTokenButton.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99

1010
/**
1111
* Class InvalidateTokenButton
12+
*
1213
* @package Magento\Customer\Block\Adminhtml\Edit
1314
*/
1415
class InvalidateTokenButton extends GenericButton implements ButtonProviderInterface
1516
{
1617
/**
18+
* Get button data.
19+
*
1720
* @return array
1821
*/
1922
public function getButtonData()
@@ -27,12 +30,15 @@ public function getButtonData()
2730
'class' => 'invalidate-token',
2831
'on_click' => 'deleteConfirm("' . $deleteConfirmMsg . '", "' . $this->getInvalidateTokenUrl() . '")',
2932
'sort_order' => 65,
33+
'aclResource' => 'Magento_Customer::invalidate_tokens',
3034
];
3135
}
3236
return $data;
3337
}
3438

3539
/**
40+
* Get invalidate token url.
41+
*
3642
* @return string
3743
*/
3844
public function getInvalidateTokenUrl()

app/code/Magento/Customer/Block/Adminhtml/Edit/ResetPasswordButton.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function getButtonData()
2727
'class' => 'reset reset-password',
2828
'on_click' => sprintf("location.href = '%s';", $this->getResetPasswordUrl()),
2929
'sort_order' => 60,
30+
'aclResource' => 'Magento_Customer::reset_password',
3031
];
3132
}
3233
return $data;

app/code/Magento/Customer/Controller/Adminhtml/Customer/InvalidateToken.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\Customer\Controller\Adminhtml\Customer;
99

10+
use Magento\Framework\App\Action\HttpGetActionInterface;
1011
use Magento\Integration\Api\CustomerTokenServiceInterface;
1112
use Magento\Customer\Api\AccountManagementInterface;
1213
use Magento\Customer\Api\AddressRepositoryInterface;
@@ -25,8 +26,15 @@
2526
* @SuppressWarnings(PHPMD.TooManyFields)
2627
* @SuppressWarnings(PHPMD.NumberOfChildren)
2728
*/
28-
class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index
29+
class InvalidateToken extends \Magento\Customer\Controller\Adminhtml\Index implements HttpGetActionInterface
2930
{
31+
/**
32+
* Authorization level of a basic admin session
33+
*
34+
* @see _isAllowed()
35+
*/
36+
const ADMIN_RESOURCE = 'Magento_Customer::invalidate_tokens';
37+
3038
/**
3139
* @var CustomerTokenServiceInterface
3240
*/

0 commit comments

Comments
 (0)