Skip to content

Commit aa697ce

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into MC-29444
2 parents 713d6b6 + c7a2450 commit aa697ce

File tree

88 files changed

+5453
-1931
lines changed

Some content is hidden

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

88 files changed

+5453
-1931
lines changed

app/code/Magento/AdvancedSearch/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<field id="search_suggestion_enabled">1</field>
6161
</depends>
6262
</field>
63-
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
63+
<field id="search_suggestion_count_results_enabled" translate="label comment" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
6464
<label>Show Results Count for Each Suggestion</label>
6565
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6666
<comment>When you enable this option your site may slow down.</comment>

app/code/Magento/Analytics/etc/adminhtml/system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model>
3030
<backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model>
3131
</field>
32-
<field id="vertical" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
32+
<field id="vertical" translate="hint label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
3333
<hint>Industry Data</hint>
3434
<label>Industry</label>
3535
<comment>In order to personalize your Advanced Reporting experience, please select your industry.</comment>

app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<actionsColumn name="actions" class="\Magento\AsynchronousOperations\Ui\Component\Listing\Column\Actions">
9393
<settings>
9494
<indexField>id</indexField>
95-
<label>Action</label>
95+
<label translate="true">Action</label>
9696
</settings>
9797
</actionsColumn>
9898
</columns>

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateSimpleProductWithUnicodeTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
<argument name="category" value="$$createPreReqCategory$$"/>
3232
<argument name="simpleProduct" value="ProductWithUnicode"/>
3333
</actionGroup>
34+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
35+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
3436
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="assertProductInStorefront1">
3537
<argument name="category" value="$$createPreReqCategory$$"/>
3638
<argument name="product" value="ProductWithUnicode"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminFilteringCategoryProductsUsingScopeSelectorTest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
userInput="$$createProduct1.name$$" stepKey="seeProductName4"/>
132132
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
133133
userInput="$$createProduct12.name$$" stepKey="seeProductName5"/>
134-
<waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount"/>
135134
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
136135
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName"/>
137136
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"
@@ -151,7 +150,6 @@
151150
userInput="$$createProduct2.name$$" stepKey="seeProductName6"/>
152151
<see selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct12.name$$)}}"
153152
userInput="$$createProduct12.name$$" stepKey="seeProductName7"/>
154-
<waitForText userInput="$$createCategory.name$$ (ID: 6) (2)" stepKey="seeCorrectProductCount2"/>
155153
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct0.name$$)}}"
156154
userInput="$$createProduct0.name$$" stepKey="dontSeeProductName2"/>
157155
<dontSee selector="{{AdminCategoryProductsGridSection.productGridNameProduct($$createProduct2.name$$)}}"

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,13 @@ protected function _saveProducts()
15691569
continue;
15701570
}
15711571

1572+
$storeId = !empty($rowData[self::COL_STORE])
1573+
? $this->getStoreIdByCode($rowData[self::COL_STORE])
1574+
: Store::DEFAULT_STORE_ID;
1575+
$rowExistingImages = $existingImages[$storeId][$rowSku] ?? [];
1576+
$rowStoreMediaGalleryValues = $rowExistingImages;
1577+
$rowExistingImages += $existingImages[Store::DEFAULT_STORE_ID][$rowSku] ?? [];
1578+
15721579
if (self::SCOPE_STORE == $rowScope) {
15731580
// set necessary data from SCOPE_DEFAULT row
15741581
$rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($rowSku)['type_id'];
@@ -1672,19 +1679,16 @@ protected function _saveProducts()
16721679

16731680
// 5. Media gallery phase
16741681
list($rowImages, $rowLabels) = $this->getImagesFromRow($rowData);
1675-
$storeId = !empty($rowData[self::COL_STORE])
1676-
? $this->getStoreIdByCode($rowData[self::COL_STORE])
1677-
: Store::DEFAULT_STORE_ID;
16781682
$imageHiddenStates = $this->getImagesHiddenStates($rowData);
16791683
foreach (array_keys($imageHiddenStates) as $image) {
1680-
if (array_key_exists($rowSku, $existingImages)
1681-
&& array_key_exists($image, $existingImages[$rowSku])
1682-
) {
1683-
$rowImages[self::COL_MEDIA_IMAGE][] = $image;
1684+
//Mark image as uploaded if it exists
1685+
if (array_key_exists($image, $rowExistingImages)) {
16841686
$uploadedImages[$image] = $image;
16851687
}
1686-
1687-
if (empty($rowImages)) {
1688+
//Add image to hide to images list if it does not exist
1689+
if (empty($rowImages[self::COL_MEDIA_IMAGE])
1690+
|| !in_array($image, $rowImages[self::COL_MEDIA_IMAGE])
1691+
) {
16881692
$rowImages[self::COL_MEDIA_IMAGE][] = $image;
16891693
}
16901694
}
@@ -1725,24 +1729,29 @@ protected function _saveProducts()
17251729
continue;
17261730
}
17271731

1728-
if (isset($existingImages[$rowSku][$uploadedFile])) {
1729-
$currentFileData = $existingImages[$rowSku][$uploadedFile];
1732+
if (isset($rowExistingImages[$uploadedFile])) {
1733+
$currentFileData = $rowExistingImages[$uploadedFile];
1734+
$currentFileData['store_id'] = $storeId;
1735+
$storeMediaGalleryValueExists = isset($rowStoreMediaGalleryValues[$uploadedFile]);
1736+
if (array_key_exists($uploadedFile, $imageHiddenStates)
1737+
&& $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]
1738+
) {
1739+
$imagesForChangeVisibility[] = [
1740+
'disabled' => $imageHiddenStates[$uploadedFile],
1741+
'imageData' => $currentFileData,
1742+
'exists' => $storeMediaGalleryValueExists
1743+
];
1744+
$storeMediaGalleryValueExists = true;
1745+
}
1746+
17301747
if (isset($rowLabels[$column][$columnImageKey])
17311748
&& $rowLabels[$column][$columnImageKey] !=
17321749
$currentFileData['label']
17331750
) {
17341751
$labelsForUpdate[] = [
17351752
'label' => $rowLabels[$column][$columnImageKey],
1736-
'imageData' => $currentFileData
1737-
];
1738-
}
1739-
1740-
if (array_key_exists($uploadedFile, $imageHiddenStates)
1741-
&& $currentFileData['disabled'] != $imageHiddenStates[$uploadedFile]
1742-
) {
1743-
$imagesForChangeVisibility[] = [
1744-
'disabled' => $imageHiddenStates[$uploadedFile],
1745-
'imageData' => $currentFileData
1753+
'imageData' => $currentFileData,
1754+
'exists' => $storeMediaGalleryValueExists
17461755
];
17471756
}
17481757
} else {

app/code/Magento/CatalogImportExport/Model/Import/Product/MediaGalleryProcessor.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Framework\App\ResourceConnection;
1313
use Magento\Framework\EntityManager\MetadataPool;
1414
use Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingErrorAggregatorInterface;
15-
use Magento\Store\Model\Store;
1615

1716
/**
1817
* Process and saves images during import.
@@ -179,13 +178,15 @@ private function updateMediaGalleryField(array $data, $field)
179178
$insertData = [];
180179
foreach ($data as $datum) {
181180
$imageData = $datum['imageData'];
181+
$exists = $datum['exists'] ?? true;
182182

183-
if ($imageData[$field] === null) {
183+
if (!$exists) {
184184
$insertData[] = [
185185
$field => $datum[$field],
186186
$this->getProductEntityLinkField() => $imageData[$this->getProductEntityLinkField()],
187187
'value_id' => $imageData['value_id'],
188-
'store_id' => Store::DEFAULT_STORE_ID,
188+
'store_id' => $imageData['store_id'],
189+
'position' => $imageData['position'],
189190
];
190191
} else {
191192
$this->connection->update(
@@ -196,7 +197,7 @@ private function updateMediaGalleryField(array $data, $field)
196197
[
197198
$this->getProductEntityLinkField() . ' = ?' => $imageData[$this->getProductEntityLinkField()],
198199
'value_id = ?' => $imageData['value_id'],
199-
'store_id = ?' => Store::DEFAULT_STORE_ID,
200+
'store_id = ?' => $imageData['store_id'],
200201
]
201202
);
202203
}
@@ -240,14 +241,15 @@ public function getExistingImages(array $bunch)
240241
)->joinLeft(
241242
['mgv' => $this->mediaGalleryValueTableName],
242243
sprintf(
243-
'(mg.value_id = mgv.value_id AND mgv.%s = mgvte.%s AND mgv.store_id = %d)',
244+
'(mgv.%s = mgvte.%s AND mg.value_id = mgv.value_id)',
244245
$this->getProductEntityLinkField(),
245-
$this->getProductEntityLinkField(),
246-
Store::DEFAULT_STORE_ID
246+
$this->getProductEntityLinkField()
247247
),
248248
[
249+
'store_id' => 'mgv.store_id',
249250
'label' => 'mgv.label',
250251
'disabled' => 'mgv.disabled',
252+
'position' => 'mgv.position',
251253
]
252254
)->joinInner(
253255
['pe' => $this->productEntityTableName],
@@ -259,7 +261,9 @@ public function getExistingImages(array $bunch)
259261
);
260262

261263
foreach ($this->connection->fetchAll($select) as $image) {
262-
$result[$image['sku']][$image['value']] = $image;
264+
$storeId = $image['store_id'];
265+
unset($image['store_id']);
266+
$result[$storeId][$image['sku']][$image['value']] = $image;
263267
}
264268

265269
return $result;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontClickHeaderLinkActionGroup">
11+
<annotations>
12+
<description>Clicks a link in the storefront header.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="linkName" type="string" defaultValue="Create an Account"/>
16+
</arguments>
17+
18+
<click stepKey="clickTheLink" selector="{{StorefrontHeaderSection.headerLinkByText(linkName)}}"/>
19+
<waitForPageLoad stepKey="wait"/>
20+
</actionGroup>
21+
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="StorefrontSeeHeaderLinksActionGroup">
11+
<annotations>
12+
<description>See a link by name in the storefront header.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="linkName" type="string" defaultValue="Create an Account"/>
16+
</arguments>
17+
<see stepKey="seeElement" selector="{{StorefrontHeaderSection.headerlinks}}" userInput="{{linkName}}"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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="StorefrontHeaderSection">
12+
<element name="headerlinks" type="text" selector="ul.header.links"/>
13+
<element name="headerLinkByText" type="text" selector="//ul[contains(@class, 'header') and contains(@class, 'links')]/li/a[contains(text(),'{{LinkName}}')]" parameterized="true"/>
14+
</section>
15+
</sections>

0 commit comments

Comments
 (0)