Skip to content

Commit 3113712

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into MC-34251
2 parents 6b57698 + c8794cb commit 3113712

File tree

2,097 files changed

+21287
-87354
lines changed

Some content is hidden

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

2,097 files changed

+21287
-87354
lines changed

app/code/Magento/AdminAnalytics/etc/db_schema.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="admin_analytics_usage_version_log" resource="default" engine="innodb"
1111
comment="Admin Notification Viewer Log Table">
12-
<column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
12+
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true"
1313
comment="Log ID"/>
1414
<column xsi:type="varchar" name="last_viewed_in_version" nullable="false" length="50"
1515
comment="Viewer last viewed on product version"/>

app/code/Magento/AdminNotification/etc/db_schema.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="adminnotification_inbox" resource="default" engine="innodb" comment="Adminnotification Inbox">
11-
<column xsi:type="int" name="notification_id" padding="10" unsigned="true" nullable="false" identity="true"
11+
<column xsi:type="int" name="notification_id" unsigned="true" nullable="false" identity="true"
1212
comment="Notification ID"/>
13-
<column xsi:type="smallint" name="severity" padding="5" unsigned="true" nullable="false" identity="false"
13+
<column xsi:type="smallint" name="severity" unsigned="true" nullable="false" identity="false"
1414
default="0" comment="Problem type"/>
1515
<column xsi:type="timestamp" name="date_added" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
1616
comment="Create date"/>
1717
<column xsi:type="varchar" name="title" nullable="false" length="255" comment="Title"/>
1818
<column xsi:type="text" name="description" nullable="true" comment="Description"/>
1919
<column xsi:type="varchar" name="url" nullable="true" length="255" comment="Url"/>
20-
<column xsi:type="smallint" name="is_read" padding="5" unsigned="true" nullable="false" identity="false"
20+
<column xsi:type="smallint" name="is_read" unsigned="true" nullable="false" identity="false"
2121
default="0" comment="Flag if notification read"/>
22-
<column xsi:type="smallint" name="is_remove" padding="5" unsigned="true" nullable="false" identity="false"
22+
<column xsi:type="smallint" name="is_remove" unsigned="true" nullable="false" identity="false"
2323
default="0" comment="Flag if notification might be removed"/>
2424
<constraint xsi:type="primary" referenceId="PRIMARY">
2525
<column name="notification_id"/>
@@ -36,7 +36,7 @@
3636
</table>
3737
<table name="admin_system_messages" resource="default" engine="innodb" comment="Admin System Messages">
3838
<column xsi:type="varchar" name="identity" nullable="false" length="100" comment="Message ID"/>
39-
<column xsi:type="smallint" name="severity" padding="5" unsigned="true" nullable="false" identity="false"
39+
<column xsi:type="smallint" name="severity" unsigned="true" nullable="false" identity="false"
4040
default="0" comment="Problem type"/>
4141
<column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
4242
comment="Create date"/>

app/code/Magento/AdvancedSearch/Model/Client/ClientResolver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*/
66
namespace Magento\AdvancedSearch\Model\Client;
77

8-
use \Magento\Framework\ObjectManagerInterface;
8+
use Magento\Framework\ObjectManagerInterface;
99
use Magento\Framework\Search\EngineResolverInterface;
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
1011

1112
/**
1213
* @api
@@ -46,7 +47,7 @@ class ClientResolver
4647
private $clientOptionsPool;
4748

4849
/**
49-
* @var EngineResolver
50+
* @var EngineResolverInterface
5051
*/
5152
private $engineResolver;
5253

app/code/Magento/AdvancedSearch/Model/Indexer/Fulltext/Plugin/CustomerGroup.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use Magento\Framework\Model\AbstractModel;
1313
use Magento\Catalog\Model\ResourceModel\Attribute;
1414
use Magento\AdvancedSearch\Model\Client\ClientOptionsInterface;
15-
use Magento\Framework\Search\EngineResolverInterface;
16-
use Magento\Search\Model\EngineResolver;
1715

1816
class CustomerGroup extends AbstractPlugin
1917
{
@@ -22,24 +20,16 @@ class CustomerGroup extends AbstractPlugin
2220
*/
2321
protected $clientOptions;
2422

25-
/**
26-
* @var EngineResolverInterface
27-
*/
28-
protected $engineResolver;
29-
3023
/**
3124
* @param IndexerRegistry $indexerRegistry
3225
* @param ClientOptionsInterface $clientOptions
33-
* @param EngineResolverInterface $engineResolver
3426
*/
3527
public function __construct(
3628
IndexerRegistry $indexerRegistry,
37-
ClientOptionsInterface $clientOptions,
38-
EngineResolverInterface $engineResolver
29+
ClientOptionsInterface $clientOptions
3930
) {
4031
parent::__construct($indexerRegistry);
4132
$this->clientOptions = $clientOptions;
42-
$this->engineResolver = $engineResolver;
4333
}
4434

4535
/**
@@ -56,9 +46,7 @@ public function aroundSave(
5646
\Closure $proceed,
5747
AbstractModel $group
5848
) {
59-
$needInvalidation =
60-
($this->engineResolver->getCurrentSearchEngine() != EngineResolver::CATALOG_SEARCH_MYSQL_ENGINE)
61-
&& ($group->isObjectNew() || $group->dataHasChangedFor('tax_class_id'));
49+
$needInvalidation = $group->isObjectNew() || $group->dataHasChangedFor('tax_class_id');
6250
$result = $proceed($group);
6351
if ($needInvalidation) {
6452
$this->indexerRegistry->get(Fulltext::INDEXER_ID)->invalidate();

app/code/Magento/AdvancedSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/CustomerGroupTest.php

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
use Magento\Customer\Model\ResourceModel\Group as CustomerGroupResourceModel;
1515
use Magento\Framework\Indexer\IndexerInterface;
1616
use Magento\Framework\Indexer\IndexerRegistry;
17-
use Magento\Framework\Search\EngineResolverInterface;
1817
use PHPUnit\Framework\TestCase;
18+
use PHPUnit\Framework\MockObject\MockObject;
1919

2020
/**
2121
* @covers \Magento\AdvancedSearch\Model\Indexer\Fulltext\Plugin\CustomerGroup
@@ -35,7 +35,7 @@ class CustomerGroupTest extends TestCase
3535
private $indexerMock;
3636

3737
/**
38-
* @var Group|MockObject
38+
* @var CustomerGroupResourceModel|MockObject
3939
*/
4040
private $subjectMock;
4141

@@ -49,11 +49,6 @@ class CustomerGroupTest extends TestCase
4949
*/
5050
private $indexerRegistryMock;
5151

52-
/**
53-
* @var EngineResolverInterface|MockObject
54-
*/
55-
private $engineResolverMock;
56-
5752
protected function setUp(): void
5853
{
5954
$this->subjectMock = $this->createMock(CustomerGroupResourceModel::class);
@@ -73,35 +68,24 @@ protected function setUp(): void
7368
IndexerRegistry::class,
7469
['get']
7570
);
76-
$this->engineResolverMock = $this->createPartialMock(
77-
EngineResolverInterface::class,
78-
['getCurrentSearchEngine']
79-
);
8071
$this->model = new CustomerGroupPlugin(
8172
$this->indexerRegistryMock,
82-
$this->customerOptionsMock,
83-
$this->engineResolverMock
73+
$this->customerOptionsMock
8474
);
8575
}
8676

8777
/**
88-
* @param string $searchEngine
8978
* @param bool $isObjectNew
9079
* @param bool $isTaxClassIdChanged
9180
* @param int $invalidateCounter
9281
* @return void
9382
* @dataProvider aroundSaveDataProvider
9483
*/
9584
public function testAroundSave(
96-
string $searchEngine,
9785
bool $isObjectNew,
9886
bool $isTaxClassIdChanged,
9987
int $invalidateCounter
10088
): void {
101-
$this->engineResolverMock->expects($this->once())
102-
->method('getCurrentSearchEngine')
103-
->willReturn($searchEngine);
104-
10589
$groupMock = $this->createPartialMock(
10690
CustomerGroupModel::class,
10791
['dataHasChangedFor', 'isObjectNew', '__wakeup']
@@ -137,14 +121,10 @@ public function testAroundSave(
137121
public function aroundSaveDataProvider(): array
138122
{
139123
return [
140-
['mysql', false, false, 0],
141-
['mysql', false, true, 0],
142-
['mysql', true, false, 0],
143-
['mysql', true, true, 0],
144-
['custom', false, false, 0],
145-
['custom', false, true, 1],
146-
['custom', true, false, 1],
147-
['custom', true, true, 1],
124+
[false, false, 0],
125+
[false, true, 1],
126+
[true, false, 1],
127+
[true, true, 1],
148128
];
149129
}
150130
}

app/code/Magento/AdvancedSearch/etc/db_schema.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
1010
<table name="catalogsearch_recommendations" resource="default" engine="innodb"
1111
comment="Advanced Search Recommendations">
12-
<column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true" comment="ID"/>
13-
<column xsi:type="int" name="query_id" padding="10" unsigned="true" nullable="false" identity="false"
12+
<column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
13+
<column xsi:type="int" name="query_id" unsigned="true" nullable="false" identity="false"
1414
default="0" comment="Query ID"/>
15-
<column xsi:type="int" name="relation_id" padding="10" unsigned="true" nullable="false" identity="false"
15+
<column xsi:type="int" name="relation_id" unsigned="true" nullable="false" identity="false"
1616
default="0" comment="Relation ID"/>
1717
<constraint xsi:type="primary" referenceId="PRIMARY">
1818
<column name="id"/>

app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
<item>Magento_Backend::custom</item>
150150
<item>Magento_Backend::tools</item>
151151
<item>Magento_Backend::cache</item>
152-
<item>Magento_Backend::setup_wizard</item>
153152
<item>Magento_Backup::backup</item>
154153
<item>Magento_Backup::rollback</item>
155154
<item>Magento_Indexer::index</item>

app/code/Magento/Analytics/etc/di.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@
163163
<item name="27" xsi:type="string">payment/cashondelivery/active</item>
164164
<item name="28" xsi:type="string">payment/paypal_billing_agreement/title</item>
165165
<item name="29" xsi:type="string">payment/paypal_billing_agreement/active</item>
166-
<item name="30" xsi:type="string">payment/braintree/title</item>
167-
<item name="31" xsi:type="string">payment/braintree/active</item>
168-
<item name="32" xsi:type="string">payment/braintree_paypal/title</item>
169-
<item name="33" xsi:type="string">payment/braintree_paypal/active</item>
170-
<item name="34" xsi:type="string">analytics/general/vertical</item>
166+
<item name="30" xsi:type="string">analytics/general/vertical</item>
171167
</argument>
172168
</arguments>
173169
</type>

app/code/Magento/AsynchronousOperations/Model/BulkOperationsStatus.php

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88

99
namespace Magento\AsynchronousOperations\Model;
1010

11-
use Magento\Framework\Exception\NoSuchEntityException;
12-
use Magento\Framework\EntityManager\EntityManager;
11+
use Magento\AsynchronousOperations\Api\BulkStatusInterface;
12+
use Magento\AsynchronousOperations\Api\Data\BulkOperationsStatusInterface;
1313
use Magento\AsynchronousOperations\Api\Data\BulkOperationsStatusInterfaceFactory as BulkStatusShortFactory;
14+
use Magento\AsynchronousOperations\Api\Data\DetailedBulkOperationsStatusInterface;
1415
use Magento\AsynchronousOperations\Api\Data\DetailedBulkOperationsStatusInterfaceFactory as BulkStatusDetailedFactory;
15-
use Magento\AsynchronousOperations\Api\Data\OperationDetailsInterfaceFactory;
16-
use Magento\AsynchronousOperations\Api\BulkStatusInterface;
17-
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\CollectionFactory;
16+
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\CollectionFactory as OperationCollectionFactory;
17+
use Magento\Framework\EntityManager\EntityManager;
18+
use Magento\Framework\Exception\NoSuchEntityException;
1819

1920
/**
20-
* Class BulkStatus
21+
* Process bulk operations status.
2122
*/
2223
class BulkOperationsStatus implements BulkStatusInterface
2324
{
@@ -42,28 +43,26 @@ class BulkOperationsStatus implements BulkStatusInterface
4243
private $bulkStatus;
4344

4445
/**
45-
* @var CollectionFactory
46+
* @var OperationCollectionFactory
4647
*/
4748
private $operationCollectionFactory;
4849

4950
/**
50-
* Init dependencies.
51-
*
5251
* @param BulkStatus $bulkStatus
53-
* @param CollectionFactory $operationCollection
52+
* @param OperationCollectionFactory $operationCollection
5453
* @param BulkStatusDetailedFactory $bulkDetailedFactory
5554
* @param BulkStatusShortFactory $bulkShortFactory
56-
* @param \Magento\Framework\EntityManager\EntityManager $entityManager
55+
* @param EntityManager $entityManager
5756
*/
5857
public function __construct(
5958
BulkStatus $bulkStatus,
60-
CollectionFactory $operationCollection,
59+
OperationCollectionFactory $operationCollection,
6160
BulkStatusDetailedFactory $bulkDetailedFactory,
6261
BulkStatusShortFactory $bulkShortFactory,
6362
EntityManager $entityManager
6463
) {
65-
$this->operationCollectionFactory = $operationCollection;
6664
$this->bulkStatus = $bulkStatus;
65+
$this->operationCollectionFactory = $operationCollection;
6766
$this->bulkDetailedFactory = $bulkDetailedFactory;
6867
$this->bulkShortFactory = $bulkShortFactory;
6968
$this->entityManager = $entityManager;
@@ -82,7 +81,10 @@ public function getFailedOperationsByBulkId($bulkUuid, $failureType = null)
8281
*/
8382
public function getOperationsCountByBulkIdAndStatus($bulkUuid, $status)
8483
{
85-
return $this->bulkStatus->getOperationsCountByBulkIdAndStatus($bulkUuid, $status);
84+
return $this->operationCollectionFactory->create()
85+
->addFieldToFilter('bulk_uuid', $bulkUuid)
86+
->addFieldToFilter('status', $status)
87+
->getSize();
8688
}
8789

8890
/**
@@ -108,7 +110,7 @@ public function getBulkDetailedStatus($bulkUuid)
108110
{
109111
$bulkSummary = $this->bulkDetailedFactory->create();
110112

111-
/** @var \Magento\AsynchronousOperations\Api\Data\DetailedBulkOperationsStatusInterface $bulk */
113+
/** @var DetailedBulkOperationsStatusInterface $bulk */
112114
$bulk = $this->entityManager->load($bulkSummary, $bulkUuid);
113115

114116
if ($bulk->getBulkId() === null) {
@@ -119,7 +121,9 @@ public function getBulkDetailedStatus($bulkUuid)
119121
)
120122
);
121123
}
122-
$operations = $this->operationCollectionFactory->create()->addFieldToFilter('bulk_uuid', $bulkUuid)->getItems();
124+
$operations = $this->operationCollectionFactory->create()
125+
->addFieldToFilter('bulk_uuid', $bulkUuid)
126+
->getItems();
123127
$bulk->setOperationsList($operations);
124128

125129
return $bulk;
@@ -132,7 +136,7 @@ public function getBulkShortStatus($bulkUuid)
132136
{
133137
$bulkSummary = $this->bulkShortFactory->create();
134138

135-
/** @var \Magento\AsynchronousOperations\Api\Data\BulkOperationsStatusInterface $bulk */
139+
/** @var BulkOperationsStatusInterface $bulk */
136140
$bulk = $this->entityManager->load($bulkSummary, $bulkUuid);
137141
if ($bulk->getBulkId() === null) {
138142
throw new NoSuchEntityException(
@@ -142,7 +146,9 @@ public function getBulkShortStatus($bulkUuid)
142146
)
143147
);
144148
}
145-
$operations = $this->operationCollectionFactory->create()->addFieldToFilter('bulk_uuid', $bulkUuid)->getItems();
149+
$operations = $this->operationCollectionFactory->create()
150+
->addFieldToFilter('bulk_uuid', $bulkUuid)
151+
->getItems();
146152
$bulk->setOperationsList($operations);
147153

148154
return $bulk;

0 commit comments

Comments
 (0)