Skip to content

Commit a7f7b64

Browse files
committed
Merge remote-tracking branch 'mainlineCE/develop' into PR_Branch
2 parents 039b352 + ba55724 commit a7f7b64

File tree

66 files changed

+2549
-1065
lines changed

Some content is hidden

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

66 files changed

+2549
-1065
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
* Fixed an issue where first store could not be selected on frontend
113113
* Fixed an issue with performance toolkit category creation
114114
* Fixed an issue when columns 'Interval', 'Price Rule' had incorrect values in Coupon Usage report
115-
* Fixed an issue where fatal error occured on Abandoned Carts report grid
115+
* Fixed an issue where fatal error occurred on Abandoned Carts report grid
116116
* Fixed an issue where it was not possible to add product to shopping cart if Use Secure URLs in Frontend = Yes
117117
* Fixed an issue where email was not required during Guest Checkout
118118
* Fixed broken ability to skip reindex in `bin/magento setup:performance:generate-fixtures` command
@@ -2699,7 +2699,7 @@
26992699
* Fixed an issue with status and visibility settings of a related product on the backend
27002700
* Fixed an issue with unused DB indexes, which used resources, but did not contribute to higher performance
27012701
* Fixed an issue where it was possible to create a downloadable product without specifying a link or a file
2702-
* Fixed an issue where a fatal error occured when opening a fixed bundle product with custom options page on the frontend
2702+
* Fixed an issue where a fatal error occurred when opening a fixed bundle product with custom options page on the frontend
27032703
* Fixed an issue where the was a wrong config key for backend cataloginventory
27042704
* Processed GitHub requests:
27052705
* [#548] (https://github.com/magento/magento2/issues/548) -- Console installer doesn't checks filesystem permissions

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanImages.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,29 @@
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

99
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Controller\ResultFactory;
1011

1112
class CleanImages extends \Magento\Backend\Controller\Adminhtml\Cache
1213
{
1314
/**
1415
* Clean JS/css files cache
1516
*
1617
* @return \Magento\Backend\Model\View\Result\Redirect
17-
* @throws LocalizedException
1818
*/
1919
public function execute()
2020
{
21-
$this->_objectManager->create('Magento\Catalog\Model\Product\Image')->clearCache();
22-
$this->_eventManager->dispatch('clean_catalog_images_cache_after');
23-
$this->messageManager->addSuccess(__('The image cache was cleaned.'));
21+
try {
22+
$this->_objectManager->create('Magento\Catalog\Model\Product\Image')->clearCache();
23+
$this->_eventManager->dispatch('clean_catalog_images_cache_after');
24+
$this->messageManager->addSuccess(__('The image cache was cleaned.'));
25+
} catch (LocalizedException $e) {
26+
$this->messageManager->addError($e->getMessage());
27+
} catch (\Exception $e) {
28+
$this->messageManager->addException($e, __('An error occurred while clearing the image cache.'));
29+
}
2430

25-
return $this->getDefaultResult();
26-
}
27-
28-
/**
29-
* {@inheritdoc}
30-
*
31-
* @return \Magento\Backend\Model\View\Result\Redirect
32-
*/
33-
public function getDefaultResult()
34-
{
35-
$resultRedirect = $this->resultRedirectFactory->create();
31+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
32+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
3633
return $resultRedirect->setPath('adminhtml/*');
3734
}
3835
}

app/code/Magento/Backend/Controller/Adminhtml/Cache/CleanMedia.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,29 @@
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

99
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Controller\ResultFactory;
1011

1112
class CleanMedia extends \Magento\Backend\Controller\Adminhtml\Cache
1213
{
1314
/**
1415
* Clean JS/css files cache
1516
*
1617
* @return \Magento\Backend\Model\View\Result\Redirect
17-
* @throws LocalizedException
1818
*/
1919
public function execute()
2020
{
21-
$this->_objectManager->get('Magento\Framework\View\Asset\MergeService')->cleanMergedJsCss();
22-
$this->_eventManager->dispatch('clean_media_cache_after');
23-
$this->messageManager->addSuccess(__('The JavaScript/CSS cache has been cleaned.'));
21+
try {
22+
$this->_objectManager->get('Magento\Framework\View\Asset\MergeService')->cleanMergedJsCss();
23+
$this->_eventManager->dispatch('clean_media_cache_after');
24+
$this->messageManager->addSuccess(__('The JavaScript/CSS cache has been cleaned.'));
25+
} catch (LocalizedException $e) {
26+
$this->messageManager->addError($e->getMessage());
27+
} catch (\Exception $e) {
28+
$this->messageManager->addException($e, __('An error occurred while clearing the JavaScript/CSS cache.'));
29+
}
2430

25-
return $this->getDefaultResult();
26-
}
27-
28-
/**
29-
* {@inheritdoc}
30-
*
31-
* @return \Magento\Backend\Model\View\Result\Redirect
32-
*/
33-
public function getDefaultResult()
34-
{
35-
$resultRedirect = $this->resultRedirectFactory->create();
31+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
32+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
3633
return $resultRedirect->setPath('adminhtml/*');
3734
}
3835
}

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassDisable.php

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,43 @@
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

99
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Controller\ResultFactory;
1011

1112
class MassDisable extends \Magento\Backend\Controller\Adminhtml\Cache
1213
{
1314
/**
1415
* Mass action for cache disabling
1516
*
1617
* @return \Magento\Backend\Model\View\Result\Redirect
17-
* @throws \Magento\Framework\Exception\LocalizedException|\Exception
1818
*/
1919
public function execute()
2020
{
21-
$types = $this->getRequest()->getParam('types');
22-
$updatedTypes = 0;
23-
if (!is_array($types)) {
24-
$types = [];
25-
}
26-
$this->_validateTypes($types);
27-
foreach ($types as $code) {
28-
if ($this->_cacheState->isEnabled($code)) {
29-
$this->_cacheState->setEnabled($code, false);
30-
$updatedTypes++;
21+
try {
22+
$types = $this->getRequest()->getParam('types');
23+
$updatedTypes = 0;
24+
if (!is_array($types)) {
25+
$types = [];
3126
}
32-
$this->_cacheTypeList->cleanType($code);
33-
}
34-
if ($updatedTypes > 0) {
35-
$this->_cacheState->persist();
36-
$this->messageManager->addSuccess(__("%1 cache type(s) disabled.", $updatedTypes));
27+
$this->_validateTypes($types);
28+
foreach ($types as $code) {
29+
if ($this->_cacheState->isEnabled($code)) {
30+
$this->_cacheState->setEnabled($code, false);
31+
$updatedTypes++;
32+
}
33+
$this->_cacheTypeList->cleanType($code);
34+
}
35+
if ($updatedTypes > 0) {
36+
$this->_cacheState->persist();
37+
$this->messageManager->addSuccess(__("%1 cache type(s) disabled.", $updatedTypes));
38+
}
39+
} catch (LocalizedException $e) {
40+
$this->messageManager->addError($e->getMessage());
41+
} catch (\Exception $e) {
42+
$this->messageManager->addException($e, __('An error occurred while disabling cache.'));
3743
}
3844

39-
return $this->getDefaultResult();
40-
}
41-
42-
/**
43-
* {@inheritdoc}
44-
*
45-
* @return \Magento\Backend\Model\View\Result\Redirect
46-
*/
47-
public function getDefaultResult()
48-
{
49-
$resultRedirect = $this->resultRedirectFactory->create();
45+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
46+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
5047
return $resultRedirect->setPath('adminhtml/*');
5148
}
5249
}

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassEnable.php

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,42 @@
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

99
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Controller\ResultFactory;
1011

1112
class MassEnable extends \Magento\Backend\Controller\Adminhtml\Cache
1213
{
1314
/**
1415
* Mass action for cache enabling
1516
*
1617
* @return \Magento\Backend\Model\View\Result\Redirect
17-
* @throws \Magento\Framework\Exception\LocalizedException|\Exception
1818
*/
1919
public function execute()
2020
{
21-
$types = $this->getRequest()->getParam('types');
22-
$updatedTypes = 0;
23-
if (!is_array($types)) {
24-
$types = [];
25-
}
26-
$this->_validateTypes($types);
27-
foreach ($types as $code) {
28-
if (!$this->_cacheState->isEnabled($code)) {
29-
$this->_cacheState->setEnabled($code, true);
30-
$updatedTypes++;
21+
try {
22+
$types = $this->getRequest()->getParam('types');
23+
$updatedTypes = 0;
24+
if (!is_array($types)) {
25+
$types = [];
3126
}
27+
$this->_validateTypes($types);
28+
foreach ($types as $code) {
29+
if (!$this->_cacheState->isEnabled($code)) {
30+
$this->_cacheState->setEnabled($code, true);
31+
$updatedTypes++;
32+
}
33+
}
34+
if ($updatedTypes > 0) {
35+
$this->_cacheState->persist();
36+
$this->messageManager->addSuccess(__("%1 cache type(s) enabled.", $updatedTypes));
37+
}
38+
} catch (LocalizedException $e) {
39+
$this->messageManager->addError($e->getMessage());
40+
} catch (\Exception $e) {
41+
$this->messageManager->addException($e, __('An error occurred while enabling cache.'));
3242
}
33-
if ($updatedTypes > 0) {
34-
$this->_cacheState->persist();
35-
$this->messageManager->addSuccess(__("%1 cache type(s) enabled.", $updatedTypes));
36-
}
37-
38-
return $this->getDefaultResult();
39-
}
4043

41-
/**
42-
* {@inheritdoc}
43-
*
44-
* @return \Magento\Backend\Model\View\Result\Redirect
45-
*/
46-
public function getDefaultResult()
47-
{
48-
$resultRedirect = $this->resultRedirectFactory->create();
44+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
45+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
4946
return $resultRedirect->setPath('adminhtml/*');
5047
}
5148
}

app/code/Magento/Backend/Controller/Adminhtml/Cache/MassRefresh.php

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,41 @@
66
*/
77
namespace Magento\Backend\Controller\Adminhtml\Cache;
88

9+
use Magento\Framework\Exception\LocalizedException;
10+
use Magento\Framework\Controller\ResultFactory;
11+
912
class MassRefresh extends \Magento\Backend\Controller\Adminhtml\Cache
1013
{
1114
/**
1215
* Mass action for cache refresh
1316
*
1417
* @return \Magento\Backend\Model\View\Result\Redirect
15-
* @throws \Magento\Framework\Exception\LocalizedException|\Exception
1618
*/
1719
public function execute()
1820
{
19-
$types = $this->getRequest()->getParam('types');
20-
$updatedTypes = 0;
21-
if (!is_array($types)) {
22-
$types = [];
23-
}
24-
$this->_validateTypes($types);
25-
foreach ($types as $type) {
26-
$this->_cacheTypeList->cleanType($type);
27-
$this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => $type]);
28-
$updatedTypes++;
29-
}
30-
if ($updatedTypes > 0) {
31-
$this->messageManager->addSuccess(__("%1 cache type(s) refreshed.", $updatedTypes));
21+
try {
22+
$types = $this->getRequest()->getParam('types');
23+
$updatedTypes = 0;
24+
if (!is_array($types)) {
25+
$types = [];
26+
}
27+
$this->_validateTypes($types);
28+
foreach ($types as $type) {
29+
$this->_cacheTypeList->cleanType($type);
30+
$this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => $type]);
31+
$updatedTypes++;
32+
}
33+
if ($updatedTypes > 0) {
34+
$this->messageManager->addSuccess(__("%1 cache type(s) refreshed.", $updatedTypes));
35+
}
36+
} catch (LocalizedException $e) {
37+
$this->messageManager->addError($e->getMessage());
38+
} catch (\Exception $e) {
39+
$this->messageManager->addException($e, __('An error occurred while refreshing cache.'));
3240
}
3341

34-
return $this->getDefaultResult();
35-
}
36-
37-
/**
38-
* {@inheritdoc}
39-
*
40-
* @return \Magento\Backend\Model\View\Result\Redirect
41-
*/
42-
public function getDefaultResult()
43-
{
44-
$resultRedirect = $this->resultRedirectFactory->create();
42+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
43+
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
4544
return $resultRedirect->setPath('adminhtml/*');
4645
}
4746
}

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,21 @@ public function __construct(
2626

2727
/**
2828
* @return \Magento\Backend\Model\View\Result\Redirect
29-
* @throws \Magento\Framework\Exception\LocalizedException|\Exception
3029
*/
3130
public function execute()
3231
{
33-
$collectionsNames = array_values($this->reportTypes);
34-
foreach ($collectionsNames as $collectionName) {
35-
$this->_objectManager->create($collectionName)->aggregate();
32+
try {
33+
$collectionsNames = array_values($this->reportTypes);
34+
foreach ($collectionsNames as $collectionName) {
35+
$this->_objectManager->create($collectionName)->aggregate();
36+
}
37+
$this->messageManager->addSuccess(__('We updated lifetime statistic.'));
38+
} catch (\Exception $e) {
39+
$this->messageManager->addError(__('We can\'t refresh lifetime statistics.'));
40+
$this->logger->critical($e);
3641
}
37-
$this->messageManager->addSuccess(__('We updated lifetime statistic.'));
3842

39-
return $this->getDefaultResult();
40-
}
41-
42-
/**
43-
* {@inheritdoc}
44-
*
45-
* @return \Magento\Backend\Model\View\Result\Redirect
46-
*/
47-
public function getDefaultResult()
48-
{
43+
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
4944
$resultRedirect = $this->resultRedirectFactory->create();
5045
return $resultRedirect->setPath('*/*');
5146
}

0 commit comments

Comments
 (0)