Skip to content

Commit 46fdcb8

Browse files
committed
Merge branch '2.4-develop' into patch-1
2 parents 46c5260 + 9728fe3 commit 46fdcb8

File tree

586 files changed

+39107
-15808
lines changed

Some content is hidden

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

586 files changed

+39107
-15808
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 development team, fork the
3333
1. Search current [listed issues](https://github.com/magento/magento2/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
3434
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3535
3. Create and test your work.
36-
4. Fork the Magento 2 repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request).
36+
4. Follow the [Forks And Pull Requests Instructions](https://devdocs.magento.com/contributor-guide/contributing.html#forks-and-pull-requests) to fork the Magento 2 repository and send us a pull request.
3737
5. Once your contribution is received the Magento 2 development team will review the contribution and collaborate with you as needed.
3838

3939
## Code of Conduct
@@ -43,6 +43,6 @@ The full text is available in the repository [Wiki](https://github.com/magento/m
4343

4444
## Connecting with Community!
4545

46-
If you have any questions, join us in [#beginners](https://magentocommeng.slack.com/messages/CH8BGFX9D) Slack chat. If you are not on our slack, [click here](http://tinyurl.com/engcom-slack) to join.
46+
If you have any questions, join us in [#beginners](https://magentocommeng.slack.com/archives/CH8BGFX9D) Slack chat. If you are not on our slack, [click here](http://tinyurl.com/engcom-slack) to join.
4747

4848
Need to find a project? Check out the [Slack Channels](https://github.com/magento/magento2/wiki/Slack-Channels) (with listed project info) and the [Magento Community Portal](https://opensource.magento.com/).

app/code/Magento/AdminNotification/view/adminhtml/web/system/notification.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define([
5252
tmpl = $(tmpl);
5353

5454
this.element.html(
55-
$('<ul />', {
55+
$('<ul></ul>', {
5656
'class': 'message-system-list'
5757
}).append(tmpl)
5858
).trigger('contentUpdated');

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,14 @@ public function scheduleBulk($bulkUuid, array $operations, $description, $userId
119119
$bulkSummary->setOperationCount((int)$bulkSummary->getOperationCount() + count($operations));
120120
$this->entityManager->save($bulkSummary);
121121

122+
$this->publishOperations($operations);
123+
122124
$connection->commit();
123125
} catch (\Exception $exception) {
124126
$connection->rollBack();
125127
$this->logger->critical($exception->getMessage());
126128
return false;
127129
}
128-
$this->publishOperations($operations);
129130

130131
return true;
131132
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,17 @@ public function publishMass($topicName, array $entitiesArray, $groupId = null, $
166166
}
167167
}
168168

169-
$this->saveMultipleOperations->execute($operations);
170169
if (!$this->bulkManagement->scheduleBulk($groupId, $operations, $bulkDescription, $userId)) {
171-
throw new LocalizedException(
172-
__('Something went wrong while processing the request.')
173-
);
170+
try {
171+
$this->bulkManagement->deleteBulk($groupId);
172+
} finally {
173+
throw new LocalizedException(
174+
__('Something went wrong while processing the request.')
175+
);
176+
}
174177
}
178+
$this->saveMultipleOperations->execute($operations);
179+
175180
/** @var AsyncResponseInterface $asyncResponse */
176181
$asyncResponse = $this->asyncResponseFactory->create();
177182
$asyncResponse->setBulkUuid($groupId);

app/code/Magento/AsynchronousOperations/Test/Unit/Model/BulkManagementTest.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,85 @@ public function testScheduleBulkWithException()
186186
$this->assertFalse($this->bulkManagement->scheduleBulk($bulkUuid, [$operation], $description, $userId));
187187
}
188188

189+
/**
190+
* Test for scheduleBulk method with exception during publishing.
191+
*
192+
* @return void
193+
*/
194+
public function testScheduleBulkWithExceptionDuringPublishing()
195+
{
196+
$bulkUuid = 'bulk-001';
197+
$description = 'Bulk summary description...';
198+
$userId = 1;
199+
$userType = UserContextInterface::USER_TYPE_ADMIN;
200+
$connectionName = 'default';
201+
$exceptionMessage = 'Exception message';
202+
$operation = $this->createMock(OperationInterface::class);
203+
$metadata = $this->createMock(EntityMetadataInterface::class);
204+
$this->metadataPool->expects($this->once())
205+
->method('getMetadata')
206+
->with(BulkSummaryInterface::class)
207+
->willReturn($metadata);
208+
$metadata->expects($this->once())
209+
->method('getEntityConnectionName')
210+
->willReturn($connectionName);
211+
$connection = $this->createMock(AdapterInterface::class);
212+
$this->resourceConnection->expects($this->once())
213+
->method('getConnectionByName')
214+
->with($connectionName)
215+
->willReturn($connection);
216+
$connection->expects($this->once())
217+
->method('beginTransaction')
218+
->willReturnSelf();
219+
$bulkSummary = $this->createMock(BulkSummaryInterface::class);
220+
$this->bulkSummaryFactory->expects($this->once())
221+
->method('create')
222+
->willReturn($bulkSummary);
223+
$this->entityManager->expects($this->once())
224+
->method('load')
225+
->with($bulkSummary, $bulkUuid)
226+
->willReturn($bulkSummary);
227+
$bulkSummary->expects($this->once())
228+
->method('setBulkId')
229+
->with($bulkUuid)
230+
->willReturnSelf();
231+
$bulkSummary->expects($this->once())
232+
->method('setDescription')
233+
->with($description)
234+
->willReturnSelf();
235+
$bulkSummary->expects($this->once())
236+
->method('setUserId')
237+
->with($userId)
238+
->willReturnSelf();
239+
$bulkSummary->expects($this->once())
240+
->method('setUserType')
241+
->with($userType)
242+
->willReturnSelf();
243+
$bulkSummary->expects($this->once())
244+
->method('getOperationCount')
245+
->willReturn(1);
246+
$bulkSummary->expects($this->once())
247+
->method('setOperationCount')
248+
->with(2)
249+
->willReturnSelf();
250+
$this->entityManager->expects($this->once())
251+
->method('save')
252+
->with($bulkSummary)
253+
->willReturn($bulkSummary);
254+
$this->publisher->expects($this->once())
255+
->method('publish')
256+
->willThrowException(new \Exception($exceptionMessage));
257+
$connection->expects($this->never())
258+
->method('commit');
259+
$connection->expects($this->once())
260+
->method('rollBack')
261+
->willReturnSelf();
262+
$this->logger->expects($this->once())
263+
->method('critical')
264+
->with($exceptionMessage);
265+
$this->assertFalse($this->bulkManagement->scheduleBulk($bulkUuid, [$operation], $description, $userId));
266+
}
267+
189268
/**
190269
* Test for retryBulk method.
191270
*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="RemoteStorageAwsS3EnabledSuite">
10+
<before>
11+
<!-- Enable AWS S3 Remote Storage -->
12+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
13+
</before>
14+
<after>
15+
<!-- Disable Remote Storage -->
16+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
17+
</after>
18+
<include>
19+
<group name="remote_storage_aws_s3"/>
20+
</include>
21+
<exclude>
22+
<group name="remote_storage_disabled"/>
23+
<group name="remote_storage_aws_s3_pagebuilder"/>
24+
</exclude>
25+
</suite>
26+
</suites>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Suite/etc/suiteSchema.xsd">
9+
<suite name="RemoteStorageDisabledSuite">
10+
<before>
11+
<!-- Disable Remote Storage -->
12+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
13+
</before>
14+
<after>
15+
<!-- Disable Remote Storage -->
16+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
17+
</after>
18+
<include>
19+
<group name="remote_storage_disabled"/>
20+
</include>
21+
</suite>
22+
</suites>

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportBundleProductTest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,14 @@
2727
</annotations>
2828

2929
<before>
30-
<!-- Enable AWS S3 Remote Storage -->
31-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="firstSimpleProductForDynamic"/>
30+
<comment userInput="BIC workaround" stepKey="enableRemoteStorage"/>
3231
</before>
3332

3433
<after>
3534
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
3635
<argument name="path">import_export/export</argument>
3736
</helper>
38-
39-
<!-- Disable AWS S3 Remote Storage -->
40-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/>
37+
<comment userInput="BIC workaround" stepKey="disableRemoteStorage"/>
4138
</after>
4239

4340
<!-- Validate Export File on File System: Dynamic Bundle Product -->

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithFileLinksTest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@
2828
</annotations>
2929

3030
<before>
31-
<!-- Enable AWS S3 Remote Storage -->
32-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="createCategory"/>
31+
<comment userInput="BIC workaround" stepKey="enableRemoteStorage"/>
3332
</before>
3433

3534
<after>
3635
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
3736
<argument name="path">import_export/export</argument>
3837
</helper>
39-
40-
<!-- Disable AWS S3 Remote Storage -->
41-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/>
38+
<comment userInput="BIC workaround" stepKey="disableRemoteStorage"/>
4239
</after>
4340

4441
<!-- Validate Export File on S3 -->

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3ExportDownloadableProductWithURLLinksTest.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,14 @@
2828
</annotations>
2929

3030
<before>
31-
<!-- Enable AWS S3 Remote Storage -->
32-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage" before="addDownloadableDomain"/>
31+
<comment userInput="BIC workaround" stepKey="enableRemoteStorage"/>
3332
</before>
3433

3534
<after>
3635
<helper class="\Magento\AwsS3\Test\Mftf\Helper\S3FileAssertions" method="deleteDirectory" stepKey="deleteExportFileDirectory">
3736
<argument name="path">import_export/export</argument>
3837
</helper>
39-
40-
<!-- Disable AWS S3 Remote Storage -->
41-
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage" after="logout"/>
38+
<comment userInput="BIC workaround" stepKey="disableRemoteStorage"/>
4239
</after>
4340

4441
<!-- Validate Export File on S3 -->

0 commit comments

Comments
 (0)