Skip to content

Commit 2bc691a

Browse files
authored
Merge branch '2.4-develop' into korostii-patch-27523
2 parents f48cd50 + 8d90d12 commit 2bc691a

File tree

1,964 files changed

+20286
-70905
lines changed

Some content is hidden

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

1,964 files changed

+20286
-70905
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Fields marked with (*) are required. Please don't remove the template.
1111

1212
### Preconditions (*)
1313
<!---
14-
Provide the exact Magento version (example: 2.3.2) and any important information on the environment where bug is reproducible.
14+
Provide the exact Magento version (example: 2.4.0) and any important information on the environment where bug is reproducible.
1515
-->
1616
1.
1717
2.
@@ -32,3 +32,12 @@ Important: Provide a set of clear steps to reproduce this bug. We can not provid
3232
<!--- Tell us what happened instead. Include error messages and issues. -->
3333
1. [Screenshots, logs or description]
3434
2.
35+
36+
---
37+
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
38+
39+
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
40+
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
41+
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
42+
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
43+
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._

.github/ISSUE_TEMPLATE/developer-experience-issue.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,12 @@ Fields marked with (*) are required. Please don't remove the template.
1818

1919
### Proposed solution
2020
<!--- Suggest your potential solutions for this issue. -->
21+
22+
---
23+
Please provide [Severity](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
24+
25+
- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users with no workaround._
26+
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
27+
- [ ] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
28+
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
29+
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
If relevant, please provide a list of fixed issues in the format magento/magento2#<issue_number>.
2424
There could be 1 or more issues linked here and it will help us find some more information about the reasoning behind this change.
2525
-->
26-
1. magento/magento2#<issue_number>: Issue title
26+
1. Fixes magento/magento2#<issue_number>
2727

2828
### Manual testing scenarios (*)
2929
<!---

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/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/Controller/Adminhtml/Reports/Show.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Show extends Action implements HttpGetActionInterface
2727
/**
2828
* @inheritdoc
2929
*/
30-
const ADMIN_RESOURCE = 'Magento_Analytics::analytics_settings';
30+
const ADMIN_RESOURCE = 'Magento_Analytics::advanced_reporting';
3131

3232
/**
3333
* @param Context $context

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;

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

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@
66

77
namespace Magento\AsynchronousOperations\Model;
88

9-
use Magento\AsynchronousOperations\Api\Data\OperationInterface;
109
use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterface;
11-
use Magento\Framework\App\ResourceConnection;
10+
use Magento\AsynchronousOperations\Api\Data\BulkSummaryInterfaceFactory;
11+
use Magento\AsynchronousOperations\Api\Data\OperationInterface;
12+
use Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory;
1213
use Magento\AsynchronousOperations\Model\BulkStatus\CalculatedStatusSql;
14+
use Magento\AsynchronousOperations\Model\ResourceModel\Operation\Collection as OperationCollection;
15+
use Magento\Framework\App\ResourceConnection;
16+
use Magento\Framework\Bulk\BulkStatusInterface;
1317
use Magento\Framework\EntityManager\MetadataPool;
1418

1519
/**
16-
* Class BulkStatus
20+
* Process bulk operations status.
1721
*/
18-
class BulkStatus implements \Magento\Framework\Bulk\BulkStatusInterface
22+
class BulkStatus implements BulkStatusInterface
1923
{
2024
/**
21-
* @var \Magento\AsynchronousOperations\Api\Data\BulkSummaryInterfaceFactory
25+
* @var BulkSummaryInterfaceFactory
2226
*/
2327
private $bulkCollectionFactory;
2428

2529
/**
26-
* @var \Magento\AsynchronousOperations\Api\Data\OperationInterfaceFactory
30+
* @var OperationInterfaceFactory
2731
*/
2832
private $operationCollectionFactory;
2933

@@ -43,22 +47,21 @@ class BulkStatus implements \Magento\Framework\Bulk\BulkStatusInterface
4347
private $metadataPool;
4448

4549
/**
46-
* BulkStatus constructor.
4750
* @param ResourceModel\Bulk\CollectionFactory $bulkCollection
4851
* @param ResourceModel\Operation\CollectionFactory $operationCollection
4952
* @param ResourceConnection $resourceConnection
5053
* @param CalculatedStatusSql $calculatedStatusSql
5154
* @param MetadataPool $metadataPool
5255
*/
5356
public function __construct(
54-
\Magento\AsynchronousOperations\Model\ResourceModel\Bulk\CollectionFactory $bulkCollection,
55-
\Magento\AsynchronousOperations\Model\ResourceModel\Operation\CollectionFactory $operationCollection,
57+
ResourceModel\Bulk\CollectionFactory $bulkCollection,
58+
ResourceModel\Operation\CollectionFactory $operationCollection,
5659
ResourceConnection $resourceConnection,
5760
CalculatedStatusSql $calculatedStatusSql,
5861
MetadataPool $metadataPool
5962
) {
60-
$this->operationCollectionFactory = $operationCollection;
6163
$this->bulkCollectionFactory = $bulkCollection;
64+
$this->operationCollectionFactory = $operationCollection;
6265
$this->resourceConnection = $resourceConnection;
6366
$this->calculatedStatusSql = $calculatedStatusSql;
6467
$this->metadataPool = $metadataPool;
@@ -87,9 +90,22 @@ public function getFailedOperationsByBulkId($bulkUuid, $failureType = null)
8790
*/
8891
public function getOperationsCountByBulkIdAndStatus($bulkUuid, $status)
8992
{
90-
/** @var \Magento\AsynchronousOperations\Model\ResourceModel\Operation\Collection $collection */
91-
$collection = $this->operationCollectionFactory->create();
92-
return $collection->addFieldToFilter('bulk_uuid', $bulkUuid)
93+
/** @var OperationCollection $operationCollection */
94+
$operationCollection = $this->operationCollectionFactory->create();
95+
if ($status === OperationInterface::STATUS_TYPE_OPEN) {
96+
$allProcessedOperationsQty = $operationCollection
97+
->addFieldToFilter('bulk_uuid', $bulkUuid)
98+
->getSize();
99+
100+
if (empty($allProcessedOperationsQty)) {
101+
return $this->getOperationCount($bulkUuid);
102+
}
103+
104+
$operationCollection->clear();
105+
}
106+
107+
return $operationCollection
108+
->addFieldToFilter('bulk_uuid', $bulkUuid)
93109
->addFieldToFilter('status', $status)
94110
->getSize();
95111
}

0 commit comments

Comments
 (0)