Skip to content

Commit 1678351

Browse files
authored
Merge branch '2.4.7-beta3-develop' into Hammer-2.4.7-Beta3-Delivery-22feb
2 parents ab55f38 + 10fc5bf commit 1678351

File tree

8 files changed

+63
-7
lines changed

8 files changed

+63
-7
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\CatalogImportExport\Model\Import;
88

9+
use Magento\AwsS3\Driver\AwsS3;
910
use Magento\Catalog\Api\ProductRepositoryInterface;
1011
use Magento\Catalog\Model\Config as CatalogConfig;
1112
use Magento\Catalog\Model\Indexer\Product\Category as ProductCategoryIndexer;
@@ -2309,6 +2310,14 @@ protected function _getUploader()
23092310

23102311
$tmpPath = $this->getImportDir();
23112312

2313+
if (is_a($this->_mediaDirectory->getDriver(), AwsS3::class)) {
2314+
if (!$this->_mediaDirectory->create($tmpPath)) {
2315+
throw new LocalizedException(
2316+
__('Directory \'%1\' could not be created.', $tmpPath)
2317+
);
2318+
}
2319+
}
2320+
23122321
if (!$fileUploader->setTmpDir($tmpPath)) {
23132322
throw new LocalizedException(
23142323
__('File directory \'%1\' is not readable.', $tmpPath)

app/code/Magento/CatalogImportExport/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"magento/module-media-storage": "*",
1818
"magento/module-store": "*",
1919
"magento/module-tax": "*",
20-
"magento/module-authorization": "*"
20+
"magento/module-authorization": "*",
21+
"magento/module-aws-s3": "*"
2122
},
2223
"type": "magento2-module",
2324
"license": [

app/code/Magento/ConfigurableProduct/etc/adminhtml/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,7 @@
8181
<type name="Magento\Sales\Model\Order\Invoice">
8282
<plugin name="update_configurable_product_total_qty" type="Magento\ConfigurableProduct\Plugin\Model\Order\Invoice\UpdateConfigurableProductTotalQty"/>
8383
</type>
84+
<type name="Magento\CatalogWidget\Block\Product\ProductsList">
85+
<plugin name="configurable_product_widget_product_list" type="Magento\ConfigurableProduct\Plugin\CatalogWidget\Block\Product\ProductsListPlugin" sortOrder="2"/>
86+
</type>
8487
</config>

app/code/Magento/ConfigurableProduct/etc/di.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
<preference for="Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\OptionsSelectBuilderInterface" type="Magento\ConfigurableProduct\Model\ResourceModel\Product\Indexer\Price\OptionsSelectBuilder" />
2222
<preference for="Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsFilterInterface" type="Magento\ConfigurableProduct\Pricing\Price\ConfigurableOptionsCompositeFilter" />
2323

24-
<type name="Magento\CatalogWidget\Block\Product\ProductsList">
25-
<plugin name="configurable_product_widget_product_list" type="Magento\ConfigurableProduct\Plugin\CatalogWidget\Block\Product\ProductsListPlugin" sortOrder="2"/>
26-
</type>
2724
<type name="Magento\CatalogInventory\Model\Quote\Item\QuantityValidator\Initializer\Option">
2825
<plugin name="configurable_product" type="Magento\ConfigurableProduct\Model\Quote\Item\QuantityValidator\Initializer\Option\Plugin\ConfigurableProduct" sortOrder="50" />
2926
</type>

app/code/Magento/ConfigurableProduct/etc/frontend/di.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@
2323
</argument>
2424
</arguments>
2525
</type>
26+
<type name="Magento\CatalogWidget\Block\Product\ProductsList">
27+
<plugin name="configurable_product_widget_product_list" type="Magento\ConfigurableProduct\Plugin\CatalogWidget\Block\Product\ProductsListPlugin" sortOrder="2"/>
28+
</type>
2629
</config>

app/code/Magento/DownloadableImportExport/Helper/Uploader.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\DownloadableImportExport\Helper;
77

88
use Magento\Framework\App\Filesystem\DirectoryList;
9+
use Magento\Framework\Exception\LocalizedException;
910
use Magento\Framework\Filesystem\Driver\File;
1011

1112
/**
@@ -76,7 +77,7 @@ public function __construct(
7677
* @param string $type
7778
* @param array $parameters
7879
* @return \Magento\CatalogImportExport\Model\Import\Uploader
79-
* @throws \Magento\Framework\Exception\LocalizedException
80+
* @throws LocalizedException
8081
*/
8182
public function getUploader($type, $parameters)
8283
{
@@ -94,8 +95,14 @@ public function getUploader($type, $parameters)
9495
$tmpPath = $dirAddon . '/' . $this->mediaDirectory->getRelativePath('import');
9596
}
9697

98+
if (!$this->mediaDirectory->create($tmpPath)) {
99+
throw new LocalizedException(
100+
__('Directory \'%1\' could not be created.', $tmpPath)
101+
);
102+
}
103+
97104
if (!$this->fileUploader->setTmpDir($tmpPath)) {
98-
throw new \Magento\Framework\Exception\LocalizedException(
105+
throw new LocalizedException(
99106
__('File directory \'%1\' is not readable.', $tmpPath)
100107
);
101108
}
@@ -104,7 +111,7 @@ public function getUploader($type, $parameters)
104111

105112
$this->mediaDirectory->create($destinationPath);
106113
if (!$this->fileUploader->setDestDir($destinationPath)) {
107-
throw new \Magento\Framework\Exception\LocalizedException(
114+
throw new LocalizedException(
108115
__('File directory \'%1\' is not writable.', $destinationPath)
109116
);
110117
}

dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductCanonicalUrlTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,38 @@
77

88
namespace Magento\GraphQl\Catalog;
99

10+
use Magento\Catalog\Model\Indexer\Category\Product;
11+
use Magento\Catalog\Model\Indexer\Product\Category;
12+
use Magento\CatalogSearch\Model\Indexer\Fulltext as IndexerSearch;
13+
use Magento\Indexer\Model\Indexer;
14+
use Magento\TestFramework\Helper\Bootstrap;
15+
use Magento\TestFramework\ObjectManager;
1016
use Magento\TestFramework\TestCase\GraphQlAbstract;
1117

1218
/**
1319
* Test for getting canonical_url for products
1420
*/
1521
class ProductCanonicalUrlTest extends GraphQlAbstract
1622
{
23+
/** @var ObjectManager */
24+
private $objectManager;
25+
26+
/**
27+
* @inheritdoc
28+
*/
29+
protected function setUp(): void
30+
{
31+
$this->objectManager = Bootstrap::getObjectManager();
32+
}
33+
1734
/**
1835
* @magentoApiDataFixture Magento/Catalog/_files/product_simple.php
1936
* @magentoConfigFixture default_store catalog/seo/product_canonical_tag 1
2037
*
2138
*/
2239
public function testProductWithCanonicalLinksMetaTagSettingsEnabled()
2340
{
41+
$this->reindex();
2442
$productSku = 'simple';
2543
$query
2644
= <<<QUERY
@@ -71,4 +89,15 @@ public function testProductWithCanonicalLinksMetaTagSettingsDisabled()
7189
);
7290
$this->assertEquals('simple', $response['products']['items'][0]['sku']);
7391
}
92+
93+
private function reindex()
94+
{
95+
$indexer = $this->objectManager->create(Indexer::class);
96+
$indexer->load(Product::INDEXER_ID);
97+
$indexer->reindexAll();
98+
$indexer->load(Category::INDEXER_ID);
99+
$indexer->reindexAll();
100+
$indexer->load(IndexerSearch::INDEXER_ID);
101+
$indexer->reindexAll();
102+
}
74103
}

dev/tests/api-functional/testsuite/Magento/GraphQl/ConfigurableProduct/ConfigurableOptionsSelectionTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ class ConfigurableOptionsSelectionTest extends GraphQlAbstract
4242
*/
4343
private $idEncoder;
4444

45+
/**
46+
* @var AttributeInterface
47+
*/
4548
private $firstConfigurableAttribute;
4649

50+
/**
51+
* @var AttributeInterface
52+
*/
4753
private $secondConfigurableAttribute;
4854

4955
/**
@@ -338,6 +344,7 @@ private function reindexAll(): void
338344
{
339345
$indexLists = [
340346
'catalog_category_product',
347+
'catalog_product_category',
341348
'catalog_product_attribute',
342349
'cataloginventory_stock',
343350
'catalogsearch_fulltext',

0 commit comments

Comments
 (0)