Skip to content

Commit b7d2f98

Browse files
author
ybohaienko
committed
Merge branch '2.3-develop' into MAGETWO-88666
2 parents cad43da + a04f913 commit b7d2f98

File tree

118 files changed

+5116
-1070
lines changed

Some content is hidden

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

118 files changed

+5116
-1070
lines changed

app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;
1717
use Magento\Framework\Search\Request\IndexScopeResolverInterface as TableResolver;
1818
use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory;
19+
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
1920

2021
/**
2122
* @api
@@ -47,12 +48,17 @@ class Index extends AbstractDb
4748
*/
4849
private $dimensionCollectionFactory;
4950

51+
/**
52+
* @var int|null
53+
*/
54+
private $websiteId;
55+
5056
/**
5157
* Index constructor.
5258
* @param Context $context
5359
* @param StoreManagerInterface $storeManager
5460
* @param MetadataPool $metadataPool
55-
* @param null $connectionName
61+
* @param string|null $connectionName
5662
* @param TableResolver|null $tableResolver
5763
* @param DimensionCollectionFactory|null $dimensionCollectionFactory
5864
*/
@@ -94,12 +100,17 @@ protected function _getCatalogProductPriceData($productIds = null)
94100
$catalogProductIndexPriceSelect = [];
95101

96102
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
97-
$catalogProductIndexPriceSelect[] = $connection->select()->from(
98-
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
99-
['entity_id', 'customer_group_id', 'website_id', 'min_price']
100-
);
101-
if ($productIds) {
102-
current($catalogProductIndexPriceSelect)->where('entity_id IN (?)', $productIds);
103+
if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||
104+
$this->websiteId === null ||
105+
$dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {
106+
$select = $connection->select()->from(
107+
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
108+
['entity_id', 'customer_group_id', 'website_id', 'min_price']
109+
);
110+
if ($productIds) {
111+
$select->where('entity_id IN (?)', $productIds);
112+
}
113+
$catalogProductIndexPriceSelect[] = $select;
103114
}
104115
}
105116

@@ -123,9 +134,12 @@ protected function _getCatalogProductPriceData($productIds = null)
123134
*/
124135
public function getPriceIndexData($productIds, $storeId)
125136
{
137+
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
138+
139+
$this->websiteId = $websiteId;
126140
$priceProductsIndexData = $this->_getCatalogProductPriceData($productIds);
141+
$this->websiteId = null;
127142

128-
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
129143
if (!isset($priceProductsIndexData[$websiteId])) {
130144
return [];
131145
}

app/code/Magento/Authorizenet/Controller/Directpost/Payment/BackendResponse.php

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
use Magento\Authorizenet\Model\Directpost;
1111
use Magento\Authorizenet\Model\DirectpostFactory;
1212
use Magento\Framework\App\Action\Context;
13+
use Magento\Framework\App\CsrfAwareActionInterface;
14+
use Magento\Framework\App\Request\InvalidRequestException;
15+
use Magento\Framework\App\RequestInterface;
1316
use Magento\Framework\Controller\ResultFactory;
1417
use Magento\Framework\Exception\LocalizedException;
1518
use Magento\Framework\Registry;
1619
use Psr\Log\LoggerInterface;
1720

18-
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment
21+
class BackendResponse extends \Magento\Authorizenet\Controller\Directpost\Payment implements CsrfAwareActionInterface
1922
{
2023
/**
2124
* @var LoggerInterface
@@ -48,6 +51,23 @@ public function __construct(
4851
$this->logger = $logger ?: $this->_objectManager->get(LoggerInterface::class);
4952
}
5053

54+
/**
55+
* @inheritDoc
56+
*/
57+
public function createCsrfValidationException(
58+
RequestInterface $request
59+
): ?InvalidRequestException {
60+
return null;
61+
}
62+
63+
/**
64+
* @inheritDoc
65+
*/
66+
public function validateForCsrf(RequestInterface $request): ?bool
67+
{
68+
return true;
69+
}
70+
5171
/**
5272
* Response action.
5373
* Action for Authorize.net SIM Relay Request.

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Response.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,29 @@
66
*/
77
namespace Magento\Authorizenet\Controller\Directpost\Payment;
88

9-
class Response extends \Magento\Authorizenet\Controller\Directpost\Payment
9+
use Magento\Framework\App\CsrfAwareActionInterface;
10+
use Magento\Framework\App\Request\InvalidRequestException;
11+
use Magento\Framework\App\RequestInterface;
12+
13+
class Response extends \Magento\Authorizenet\Controller\Directpost\Payment implements CsrfAwareActionInterface
1014
{
15+
/**
16+
* @inheritDoc
17+
*/
18+
public function createCsrfValidationException(
19+
RequestInterface $request
20+
): ?InvalidRequestException {
21+
return null;
22+
}
23+
24+
/**
25+
* @inheritDoc
26+
*/
27+
public function validateForCsrf(RequestInterface $request): ?bool
28+
{
29+
return true;
30+
}
31+
1132
/**
1233
* Response action.
1334
* Action for Authorize.net SIM Relay Request.

app/code/Magento/Backup/Model/BackupFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function __construct(\Magento\Framework\ObjectManagerInterface $objectMan
3939
*/
4040
public function create($timestamp, $type)
4141
{
42-
$fsCollection = $this->_objectManager->get(\Magento\Backup\Model\Fs\Collection::class);
43-
$backupInstance = $this->_objectManager->get(\Magento\Backup\Model\Backup::class);
42+
$fsCollection = $this->_objectManager->create(\Magento\Backup\Model\Fs\Collection::class);
43+
$backupInstance = $this->_objectManager->create(\Magento\Backup\Model\Backup::class);
4444

4545
foreach ($fsCollection as $backup) {
4646
if ($backup->getTime() === (int) $timestamp && $backup->getType() === $type) {

app/code/Magento/Backup/Model/Fs/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ protected function _generateRow($filename)
115115
if (isset($row['display_name']) && $row['display_name'] == '') {
116116
$row['display_name'] = 'WebSetupWizard';
117117
}
118-
$row['id'] = $row['time'] . '_' . $row['type'] . (isset($row['display_name']) ? $row['display_name'] : '');
118+
$row['id'] = $row['time'] . '_' . $row['type']
119+
. (isset($row['display_name']) ? '_' . $row['display_name'] : '');
119120
return $row;
120121
}
121122
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
12+
<actionGroup name="createSystemBackup">
13+
<arguments>
14+
<argument name="backup" defaultValue="SystemBackup"/>
15+
</arguments>
16+
<click selector="{{AdminMainActionsSection.systemBackup}}" stepKey="clickCreateBackupButton"/>
17+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
18+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
19+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
20+
<waitForElementNotVisible selector=".loading-mask" time="300" stepKey="waitForBackupProcess"/>
21+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the system backup." stepKey="seeSuccessMessage"/>
22+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
23+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
24+
</actionGroup>
25+
26+
<actionGroup name="createMediaBackup">
27+
<arguments>
28+
<argument name="backup" defaultValue="MediaBackup"/>
29+
</arguments>
30+
<click selector="{{AdminMainActionsSection.mediaBackup}}" stepKey="clickCreateBackupButton"/>
31+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
32+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
33+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
34+
<waitForPageLoad time="120" stepKey="waitForBackupProcess"/>
35+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the database and media backup." stepKey="seeSuccessMessage"/>
36+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
37+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
38+
</actionGroup>
39+
40+
<actionGroup name="createDatabaseBackup">
41+
<arguments>
42+
<argument name="backup" defaultValue="DatabaseBackup"/>
43+
</arguments>
44+
<click selector="{{AdminMainActionsSection.databaseBackup}}" stepKey="clickCreateBackupButton"/>
45+
<waitForElementVisible selector="{{AdminCreateBackupFormSection.backupNameField}}" stepKey="waitForForm"/>
46+
<fillField selector="{{AdminCreateBackupFormSection.backupNameField}}" userInput="{{backup.name}}" stepKey="fillBackupName"/>
47+
<click selector="{{AdminCreateBackupFormSection.ok}}" stepKey="clickOk"/>
48+
<waitForPageLoad time="120" stepKey="waitForBackupProcess"/>
49+
<see selector="{{AdminMessagesSection.success}}" userInput="You created the database backup." stepKey="seeSuccessMessage"/>
50+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
51+
<see selector="{{AdminGridTableSection.backupTypeByName(backup.name)}}" userInput="{{backup.type}}" stepKey="seeBackupType"/>
52+
</actionGroup>
53+
54+
</actionGroups>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
12+
<actionGroup name="deleteBackup">
13+
<arguments>
14+
<argument name="backup"/>
15+
</arguments>
16+
<see selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="seeBackupInGrid"/>
17+
<click selector="{{AdminGridTableSection.backupRowCheckbox(backup.name)}}" stepKey="selectBackupRow"/>
18+
<selectOption selector="{{AdminGridActionSection.actionSelect}}" userInput="Delete" stepKey="selectDeleteAction"/>
19+
<click selector="{{AdminGridActionSection.submitButton}}" stepKey="clickSubmit"/>
20+
<see selector="{{AdminConfirmationModalSection.message}}" userInput="Are you sure you want to delete the selected backup(s)?" stepKey="seeConfirmationModal"/>
21+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickOkConfirmDelete"/>
22+
<dontSee selector="{{AdminGridTableSection.backupNameColumn}}" userInput="{{backup.name}}" stepKey="dontSeeBackupInGrid"/>
23+
</actionGroup>
24+
25+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SystemBackup" type="backup">
12+
<data key="name" unique="suffix">systemBackup</data>
13+
<data key="type">System</data>
14+
</entity>
15+
<entity name="MediaBackup" type="backup">
16+
<data key="name" unique="suffix">mediaBackup</data>
17+
<data key="type">Database and Media</data>
18+
</entity>
19+
<entity name="DatabaseBackup" type="backup">
20+
<data key="name" unique="suffix">databaseBackup</data>
21+
<data key="type">Database</data>
22+
</entity>
23+
</entities>
Lines changed: 16 additions & 0 deletions
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="BackupIndexPage" url="/backup/index/" area="admin" module="Magento_Backup">
12+
<section name="AdminMainActionsSection"/>
13+
<section name="AdminGridTableSection"/>
14+
<section name="AdminCreateBackupFormSection"/>
15+
</page>
16+
</pages>
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+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminCreateBackupFormSection">
12+
<element name="backupNameField" type="input" selector="input[name='backup_name']"/>
13+
<element name="maintenanceModeCheckbox" type="checkbox" selector="input[name='maintenance_mode']"/>
14+
<element name="excludeMediaCheckbox" type="checkbox" selector="input[name='exclude_media']"/>
15+
<element name="ok" type="button" selector=".modal-header button.primary"/>
16+
<element name="cancel" type="button" selector=".modal-header button.cancel"/>
17+
</section>
18+
</sections>

0 commit comments

Comments
 (0)