Skip to content

Commit a9e093d

Browse files
committed
Merge branch '2.4-develop' into B2B-1704
2 parents 8db7d3c + 10a7065 commit a9e093d

File tree

62 files changed

+1606
-157
lines changed

Some content is hidden

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

62 files changed

+1606
-157
lines changed

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontGoToDetailsPageWhenAddingToCartTest.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626
<magentoCron stepKey="runCronIndex" groups="index"/>
2727
</before>
2828
<after>
29-
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
3029
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
3130
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
3231
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
32+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteBundleProduct">
33+
<argument name="sku" value="{{BundleProduct.sku}}"/>
34+
</actionGroup>
35+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
36+
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
3337
</after>
3438
<!--Go to bundle product creation page-->
3539
<amOnPage url="{{AdminProductCreatePage.url(BundleProduct.set, BundleProduct.type)}}" stepKey="goToBundleProductCreationPage" />

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ private function isAttributeShouldNotBeUpdated(Product $product, array $useDefau
102102
{
103103
$considerUseDefaultsAttribute = !isset($useDefaults[$attribute]) || $useDefaults[$attribute] === '1';
104104

105-
return ($value === '' && $considerUseDefaultsAttribute && !$product->getData($attribute));
105+
return ($value === '' && $considerUseDefaultsAttribute && ($product->getData($attribute) === null));
106106
}
107107
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface;
9+
10+
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Catalog\Api\ProductLinkRepositoryInterface;
12+
use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer;
13+
14+
/**
15+
* Product reindexing after delete by id links plugin.
16+
*/
17+
class ReindexAfterDeleteByIdProductLinksPlugin
18+
{
19+
/**
20+
* @var FullProductIndexer
21+
*/
22+
private $fullProductIndexer;
23+
24+
/**
25+
* @var ProductRepositoryInterface
26+
*/
27+
private $productRepository;
28+
29+
/**
30+
* @param FullProductIndexer $fullProductIndexer
31+
* @param ProductRepositoryInterface $productRepository
32+
*/
33+
public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository)
34+
{
35+
$this->fullProductIndexer = $fullProductIndexer;
36+
$this->productRepository = $productRepository;
37+
}
38+
39+
/**
40+
* Complex reindex after product links has been deleted.
41+
*
42+
* @param ProductLinkRepositoryInterface $subject
43+
* @param bool $result
44+
* @param string $sku
45+
* @param string $type
46+
* @param string $linkedProductSku
47+
* @return bool
48+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
49+
*/
50+
public function afterDeleteById(ProductLinkRepositoryInterface $subject, bool $result, $sku): bool
51+
{
52+
$product = $this->productRepository->get($sku);
53+
$this->fullProductIndexer->executeRow($product->getId());
54+
55+
return $result;
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface;
9+
10+
use Magento\Catalog\Api\ProductRepositoryInterface;
11+
use Magento\Catalog\Api\ProductLinkRepositoryInterface;
12+
use Magento\Catalog\Api\Data\ProductLinkInterface;
13+
use Magento\Catalog\Model\Indexer\Product\Full as FullProductIndexer;
14+
15+
/**
16+
* Product reindexing after save links plugin.
17+
*/
18+
class ReindexAfterSaveProductLinksPlugin
19+
{
20+
/**
21+
* @var FullProductIndexer
22+
*/
23+
private $fullProductIndexer;
24+
25+
/**
26+
* @var ProductRepositoryInterface
27+
*/
28+
private $productRepository;
29+
30+
/**
31+
* @param FullProductIndexer $fullProductIndexer
32+
* @param ProductRepositoryInterface $productRepository
33+
*/
34+
public function __construct(FullProductIndexer $fullProductIndexer, ProductRepositoryInterface $productRepository)
35+
{
36+
$this->fullProductIndexer = $fullProductIndexer;
37+
$this->productRepository = $productRepository;
38+
}
39+
40+
/**
41+
* Complex reindex after product links has been saved.
42+
*
43+
* @param ProductLinkRepositoryInterface $subject
44+
* @param bool $result
45+
* @param ProductLinkInterface $entity
46+
* @return bool
47+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
48+
*/
49+
public function afterSave(ProductLinkRepositoryInterface $subject, bool $result, ProductLinkInterface $entity): bool
50+
{
51+
$product = $this->productRepository->get($entity->getSku());
52+
$this->fullProductIndexer->executeRow($product->getId());
53+
54+
return $result;
55+
}
56+
}

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<section name="StorefrontProductMediaSection">
1212
<element name="gallerySpinner" type="block" selector="#maincontent .fotorama__spinner--show" />
1313
<element name="gallery" type="block" selector="[data-gallery-role='gallery']" timeout="30"/>
14+
<element name="galleryNoControlsElement" type="block" selector=".fotorama__wrap.fotorama__wrap--no-controls"/>
1415
<element name="productImage" type="text" selector="//*[@data-gallery-role='gallery' and not(contains(@class, 'fullscreen'))]//img[contains(@src, '{{filename}}') and not(contains(@class, 'full'))]" parameterized="true" />
1516
<element name="productImageFullscreen" type="text" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//img[contains(@src, '{{filename}}') and contains(@class, 'full')]" parameterized="true" />
1617
<element name="closeFullscreenImage" type="button" selector="//*[@data-gallery-role='gallery' and contains(@class, 'fullscreen')]//*[@data-gallery-role='fotorama__fullscreen-icon']" />

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@
2222
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
2323
</before>
2424
<after>
25-
<amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
2625
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
26+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteProduct">
27+
<argument name="sku" value="{{_defaultProduct.sku}}"/>
28+
</actionGroup>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/>
30+
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
2731
</after>
2832

2933
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/Helper/AttributeFilterTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,29 @@ public function setupInputDataProvider()
216216
['description', null, 'descr text'],
217217
],
218218
],
219+
'update_product_with_empty_string_attribute' => [
220+
'requestProductData' => [
221+
'name' => 'testName3',
222+
'sku' => 'testSku3',
223+
'price' => '103',
224+
'special_price' => '100',
225+
'custom_attribute' => '',
226+
],
227+
'useDefaults' => [],
228+
'expectedProductData' => [
229+
'name' => 'testName3',
230+
'sku' => 'testSku3',
231+
'price' => '103',
232+
'special_price' => '100',
233+
'custom_attribute' => '',
234+
],
235+
'initialProductData' => [
236+
['name', null, 'testName2'],
237+
['sku', null, 'testSku2'],
238+
['price', null, '101'],
239+
['custom_attribute', null, '0'],
240+
],
241+
],
219242
];
220243
}
221244

app/code/Magento/Catalog/etc/webapi_rest/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
<argument name="deserializer" xsi:type="object">Magento\Catalog\Model\Product\Webapi\Rest\RequestTypeBasedDeserializer</argument>
4141
</arguments>
4242
</type>
43+
<type name="Magento\Catalog\Api\ProductLinkRepositoryInterface">
44+
<plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/>
45+
<plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/>
46+
</type>
4347
</config>

app/code/Magento/Catalog/etc/webapi_soap/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
<argument name="deserializer" xsi:type="object">Magento\Framework\Webapi\Rest\Request\Deserializer\Xml</argument>
4141
</arguments>
4242
</type>
43+
<type name="Magento\Catalog\Api\ProductLinkRepositoryInterface">
44+
<plugin name="reindex_after_save_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterSaveProductLinksPlugin"/>
45+
<plugin name="reindex_after_delete_by_id_product_links" type="Magento\Catalog\Plugin\Api\ProductLinkRepositoryInterface\ReindexAfterDeleteByIdProductLinksPlugin"/>
46+
</type>
4347
</config>

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/composite/configure.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ define([
4747
* Initialize object
4848
*/
4949
initialize: function () {
50-
var self = this;
50+
var self = this,
51+
popupDialog = jQuery('#product_composite_configure');
5152

5253
this._initWindowElements();
5354
jQuery.async('#product_composite_configure', function (el) {
55+
if (el !== popupDialog[0]) {
56+
el = popupDialog[0];
57+
}
5458
self.dialog = jQuery(el).modal({
5559
title: jQuery.mage.__('Configure Product'),
5660
type: 'slide',

0 commit comments

Comments
 (0)