Skip to content

Commit 2b21388

Browse files
Merge pull request #6538 from engcom-Foxtrot/2.4-dev-php8-sync
MC-40472: Sync php8 branches with 2.4 branches
2 parents 960a51f + 30301a5 commit 2b21388

File tree

315 files changed

+10140
-1028
lines changed

Some content is hidden

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

315 files changed

+10140
-1028
lines changed

.github/stale.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ staleLabel: "stale issue"
3939
# Comment to post when marking as stale. Set to `false` to disable
4040
markComment: >
4141
This issue has been automatically marked as stale because it has not had
42-
recent activity. It will be closed after 14 days if no further activity occurs. Thank you
43-
for your contributions.
42+
recent activity. It will be closed after 14 days if no further activity occurs.
43+
Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
44+
Thank you for your contributions!
4445
# Comment to post when removing the stale label.
4546
# unmarkComment: >
4647
# Your comment here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AwsS3AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest" extends="AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest">
12+
<annotations>
13+
<features value="AwsS3"/>
14+
<stories value="Import Products"/>
15+
<title value="S3 - Import Configurable Product With Simple Child Products With Images"/>
16+
<description value="Imports a .csv file containing a configurable product with 3 child simple products that
17+
have images. Verifies that products are imported successfully and that the images are attached to the
18+
products as expected."/>
19+
<severity value="MAJOR"/>
20+
<group value="importExport"/>
21+
<group value="remote_storage_aws_s3"/>
22+
<skip>
23+
<issueId value="MC-39280"/>
24+
</skip>
25+
</annotations>
26+
27+
<before>
28+
<!-- Enable AWS S3 Remote Storage -->
29+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.enable_options}}" stepKey="enableRemoteStorage"/>
30+
</before>
31+
32+
<after>
33+
<!-- Disable AWS S3 Remote Storage -->
34+
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
35+
</after>
36+
</test>
37+
</tests>

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
namespace Magento\Backend\Controller\Adminhtml\System\Store;
88

99
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
10+
use Magento\Store\Model\Group as StoreGroup;
11+
use Magento\Store\Model\Store;
12+
use Magento\Framework\Exception\LocalizedException;
1013

1114
/**
1215
* Class Save
@@ -33,6 +36,17 @@ private function processWebsiteSave($postData)
3336
$websiteModel->setId(null);
3437
}
3538

39+
$groupModel = $this->_objectManager->create(StoreGroup::class);
40+
$groupModel->load($websiteModel->getDefaultGroupId());
41+
$storeModel = $this->_objectManager->create(Store::class);
42+
$storeModel->load($groupModel->getDefaultStoreId());
43+
44+
if ($websiteModel->getIsDefault() && !$storeModel->isActive()) {
45+
throw new LocalizedException(
46+
__('Please enable your Store View before using this Web Site as Default')
47+
);
48+
}
49+
3650
$websiteModel->save();
3751
$this->messageManager->addSuccessMessage(__('You saved the website.'));
3852

@@ -43,13 +57,13 @@ private function processWebsiteSave($postData)
4357
* Process Store model save
4458
*
4559
* @param array $postData
46-
* @throws \Magento\Framework\Exception\LocalizedException
60+
* @throws LocalizedException
4761
* @return array
4862
*/
4963
private function processStoreSave($postData)
5064
{
51-
/** @var \Magento\Store\Model\Store $storeModel */
52-
$storeModel = $this->_objectManager->create(\Magento\Store\Model\Store::class);
65+
/** @var Store $storeModel */
66+
$storeModel = $this->_objectManager->create(Store::class);
5367
$postData['store']['name'] = $this->filterManager->removeTags($postData['store']['name']);
5468
if ($postData['store']['store_id']) {
5569
$storeModel->load($postData['store']['store_id']);
@@ -59,13 +73,13 @@ private function processStoreSave($postData)
5973
$storeModel->setId(null);
6074
}
6175
$groupModel = $this->_objectManager->create(
62-
\Magento\Store\Model\Group::class
76+
StoreGroup::class
6377
)->load(
6478
$storeModel->getGroupId()
6579
);
6680
$storeModel->setWebsiteId($groupModel->getWebsiteId());
6781
if (!$storeModel->isActive() && $storeModel->isDefault()) {
68-
throw new \Magento\Framework\Exception\LocalizedException(
82+
throw new LocalizedException(
6983
__('The default store cannot be disabled')
7084
);
7185
}
@@ -79,14 +93,14 @@ private function processStoreSave($postData)
7993
* Process StoreGroup model save
8094
*
8195
* @param array $postData
82-
* @throws \Magento\Framework\Exception\LocalizedException
96+
* @throws LocalizedException
8397
* @return array
8498
*/
8599
private function processGroupSave($postData)
86100
{
87101
$postData['group']['name'] = $this->filterManager->removeTags($postData['group']['name']);
88-
/** @var \Magento\Store\Model\Group $groupModel */
89-
$groupModel = $this->_objectManager->create(\Magento\Store\Model\Group::class);
102+
/** @var StoreGroup $groupModel */
103+
$groupModel = $this->_objectManager->create(StoreGroup::class);
90104
if ($postData['group']['group_id']) {
91105
$groupModel->load($postData['group']['group_id']);
92106
}
@@ -95,10 +109,11 @@ private function processGroupSave($postData)
95109
$groupModel->setId(null);
96110
}
97111
if (!$this->isSelectedDefaultStoreActive($postData, $groupModel)) {
98-
throw new \Magento\Framework\Exception\LocalizedException(
112+
throw new LocalizedException(
99113
__('An inactive store view cannot be saved as default store view')
100114
);
101115
}
116+
102117
$groupModel->save();
103118
$this->messageManager->addSuccessMessage(__('You saved the store.'));
104119

@@ -135,7 +150,7 @@ public function execute()
135150
}
136151
$redirectResult->setPath('adminhtml/*/');
137152
return $redirectResult;
138-
} catch (\Magento\Framework\Exception\LocalizedException $e) {
153+
} catch (LocalizedException $e) {
139154
$this->messageManager->addErrorMessage($e->getMessage());
140155
$this->_getSession()->setPostData($postData);
141156
} catch (\Exception $e) {
@@ -156,10 +171,10 @@ public function execute()
156171
* Verify if selected default store is active
157172
*
158173
* @param array $postData
159-
* @param \Magento\Store\Model\Group $groupModel
174+
* @param StoreGroup $groupModel
160175
* @return bool
161176
*/
162-
private function isSelectedDefaultStoreActive(array $postData, \Magento\Store\Model\Group $groupModel)
177+
private function isSelectedDefaultStoreActive(array $postData, StoreGroup $groupModel)
163178
{
164179
if (!empty($postData['group']['default_store_id'])) {
165180
$defaultStoreId = $postData['group']['default_store_id'];
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<actionGroup name="AdminClearGridFiltersActionGroup">
12+
<annotations>
13+
<description>Click the Clear filters on the grid.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters"/>
17+
<waitForPageLoad stepKey="waitForPageLoaded"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/Backend/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ System,System
198198
"All Stores","All Stores"
199199
"You saved the website.","You saved the website."
200200
"The default store cannot be disabled","The default store cannot be disabled"
201+
"Please enable your Store View before using this Web Site as Default","Please enable your Store View before using this Web Site as Default"
201202
"You saved the store view.","You saved the store view."
202203
"An inactive store view cannot be saved as default store view","An inactive store view cannot be saved as default store view"
203204
"You saved the store.","You saved the store."

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ public function getJsonConfig()
184184
$configValue = $preConfiguredValues->getData('bundle_option/' . $optionId);
185185
if ($configValue) {
186186
$defaultValues[$optionId] = $configValue;
187-
$configQty = $preConfiguredValues->getData('bundle_option_qty/' . $optionId);
188-
if ($configQty) {
189-
$options[$optionId]['selections'][$configValue]['qty'] = $configQty;
190-
}
191187
}
192188
$options = $this->processOptions($optionId, $options, $preConfiguredValues);
193189
}

app/code/Magento/Bundle/Model/CartItemProcessor.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
}
5252

5353
/**
54-
* {@inheritdoc}
54+
* @inheritDoc
5555
*/
5656
public function convertToBuyRequest(CartItemInterface $cartItem)
5757
{
@@ -73,7 +73,7 @@ public function convertToBuyRequest(CartItemInterface $cartItem)
7373
}
7474

7575
/**
76-
* {@inheritdoc}
76+
* @inheritDoc
7777
* @SuppressWarnings(PHPMD.NPathComplexity)
7878
*/
7979
public function processOptions(CartItemInterface $cartItem)
@@ -84,19 +84,21 @@ public function processOptions(CartItemInterface $cartItem)
8484
$productOptions = [];
8585
$bundleOptions = $cartItem->getBuyRequest()->getBundleOption();
8686
$bundleOptionsQty = $cartItem->getBuyRequest()->getBundleOptionQty();
87+
$bundleOptionsQty = is_array($bundleOptionsQty) ? $bundleOptionsQty : [];
8788
if (is_array($bundleOptions)) {
8889
foreach ($bundleOptions as $optionId => $optionSelections) {
8990
if (empty($optionSelections)) {
9091
continue;
9192
}
9293
$optionSelections = is_array($optionSelections) ? $optionSelections : [$optionSelections];
93-
$optionQty = isset($bundleOptionsQty[$optionId]) ? $bundleOptionsQty[$optionId] : 1;
9494

9595
/** @var \Magento\Bundle\Api\Data\BundleOptionInterface $productOption */
9696
$productOption = $this->bundleOptionFactory->create();
9797
$productOption->setOptionId($optionId);
9898
$productOption->setOptionSelections($optionSelections);
99-
$productOption->setOptionQty($optionQty);
99+
if (isset($bundleOptionsQty[$optionId])) {
100+
$productOption->setOptionQty($bundleOptionsQty[$optionId]);
101+
}
100102
$productOptions[] = $productOption;
101103
}
102104

0 commit comments

Comments
 (0)