Skip to content

Commit 48d79ea

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-commerce/magento2ce into ACP2E-4168
2 parents dc90b53 + e457c5e commit 48d79ea

File tree

139 files changed

+8231
-251
lines changed

Some content is hidden

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

139 files changed

+8231
-251
lines changed

app/code/Magento/Amqp/Setup/ConfigOptionsList.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
*/
66
namespace Magento\Amqp\Setup;
77

8+
use Magento\Framework\App\DeploymentConfig;
89
use Magento\Framework\Config\Data\ConfigData;
910
use Magento\Framework\Config\File\ConfigFilePool;
1011
use Magento\Framework\Setup\ConfigOptionsListInterface;
1112
use Magento\Framework\Setup\Option\TextConfigOption;
12-
use Magento\Framework\App\DeploymentConfig;
1313

1414
/**
1515
* Deployment configuration options needed for Setup application
@@ -26,6 +26,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
2626
public const INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST = 'amqp-virtualhost';
2727
public const INPUT_KEY_QUEUE_AMQP_SSL = 'amqp-ssl';
2828
public const INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS = 'amqp-ssl-options';
29+
public const INPUT_KEY_QUEUE_DEFAULT_CONNECTION ='queue-default-connection';
2930

3031
/**
3132
* Path to the values in the deployment config
@@ -203,6 +204,11 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
203204
if (!$result) {
204205
$errors[] = "Could not connect to the Amqp Server.";
205206
}
207+
208+
if (isset($options[self::INPUT_KEY_QUEUE_DEFAULT_CONNECTION])
209+
&& $options[self::INPUT_KEY_QUEUE_DEFAULT_CONNECTION] !== 'amqp') {
210+
$errors = [];
211+
}
206212
}
207213

208214
return $errors;

app/code/Magento/AsyncConfig/etc/queue_publisher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="async_config.saveConfig"/>
9+
<publisher topic="async_config.saveConfig" queue="saveConfig"/>
1010
</config>

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
namespace Magento\AsynchronousOperations\Model;
99

10+
use Magento\Framework\App\ObjectManager;
1011
use Magento\Framework\MessageQueue\CallbackInvokerInterface;
12+
use Magento\Framework\MessageQueue\Consumer\ConfigInterface as ConsumerConfig;
1113
use Magento\Framework\MessageQueue\ConsumerConfigurationInterface;
1214
use Magento\Framework\MessageQueue\ConsumerInterface;
1315
use Magento\Framework\MessageQueue\EnvelopeInterface;
@@ -41,24 +43,32 @@ class MassConsumer implements ConsumerInterface
4143
*/
4244
private $registry;
4345

46+
/**
47+
* @var ConsumerConfig
48+
*/
49+
private $consumerConfig;
50+
4451
/**
4552
* Initialize dependencies.
4653
*
4754
* @param CallbackInvokerInterface $invoker
4855
* @param ConsumerConfigurationInterface $configuration
4956
* @param MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback
5057
* @param Registry $registry
58+
* @param ConsumerConfig|null $consumerConfig
5159
*/
5260
public function __construct(
5361
CallbackInvokerInterface $invoker,
5462
ConsumerConfigurationInterface $configuration,
5563
MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback,
56-
Registry $registry
64+
Registry $registry,
65+
?ConsumerConfig $consumerConfig = null
5766
) {
5867
$this->invoker = $invoker;
5968
$this->configuration = $configuration;
6069
$this->massConsumerEnvelopeCallback = $massConsumerEnvelopeCallback;
6170
$this->registry = $registry;
71+
$this->consumerConfig = $consumerConfig ?: ObjectManager::getInstance()->get(ConsumerConfig::class);
6272
}
6373

6474
/**

app/code/Magento/Catalog/etc/queue_publisher.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="product_action_attribute.update"/>
10-
<publisher topic="product_action_attribute.website.update"/>
11-
<publisher topic="catalog_website_attribute_value_sync"/>
9+
<publisher topic="product_action_attribute.update" queue="product_action_attribute.update"/>
10+
<publisher topic="product_action_attribute.website.update" queue="product_action_attribute.website.update"/>
11+
<publisher topic="catalog_website_attribute_value_sync" queue="catalog_website_attribute_value_sync"/>
1212
</config>

app/code/Magento/CatalogGraphQl/DataProvider/Product/SearchCriteriaBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class SearchCriteriaBuilder
3838
* @param RequestDataBuilder $localData
3939
* @param SearchCriteriaResolverFactory $criteriaResolverFactory
4040
* @param ArgumentApplierPool $argumentApplierPool
41+
* @param array $partialSearchAnalyzers
4142
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
4243
*/
4344
public function __construct(
@@ -51,6 +52,7 @@ public function __construct(
5152
private readonly RequestDataBuilder $localData,
5253
private readonly SearchCriteriaResolverFactory $criteriaResolverFactory,
5354
private readonly ArgumentApplierPool $argumentApplierPool,
55+
private readonly array $partialSearchAnalyzers = []
5456
) {
5557
}
5658

@@ -117,6 +119,10 @@ private function updateMatchTypeRequestConfig(string $requestName, array $partia
117119
foreach ($query['match'] ?? [] as $index => $matchItem) {
118120
if (in_array($matchItem['field'] ?? null, $partialMatchFilters, true)) {
119121
$data['queries'][$queryName]['match'][$index]['matchCondition'] = 'match_phrase_prefix';
122+
if (array_key_exists($matchItem['field'], $this->partialSearchAnalyzers)) {
123+
$data['queries'][$queryName]['match'][$index]['analyzer']
124+
= $this->partialSearchAnalyzers[$matchItem['field']];
125+
}
120126
}
121127
}
122128
}

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Price/Discount.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ private function getPriceDifferenceAsValue(float $regularPrice, float $finalPric
7272
*/
7373
private function getPriceDifferenceAsPercent(float $regularPrice, float $finalPrice): float
7474
{
75-
$difference = $this->getPriceDifferenceAsValue($regularPrice, $finalPrice);
75+
$difference = $regularPrice - $finalPrice;
76+
if ($difference <= $this->zeroThreshold) {
77+
return 0;
78+
}
7679

7780
if ($difference <= $this->zeroThreshold || $regularPrice <= $this->zeroThreshold) {
7881
return 0;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,12 @@
150150
</argument>
151151
</arguments>
152152
</type>
153+
154+
<type name="Magento\CatalogGraphQl\DataProvider\Product\SearchCriteriaBuilder">
155+
<arguments>
156+
<argument name="partialSearchAnalyzers" xsi:type="array">
157+
<item name="name" xsi:type="string">prefix_search</item>
158+
</argument>
159+
</arguments>
160+
</type>
153161
</config>

app/code/Magento/CatalogRule/Model/Indexer/ProductPriceCalculator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2017 Adobe
44
* All Rights Reserved.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\CatalogRule\Model\Indexer;
89

@@ -28,7 +29,7 @@ public function __construct(\Magento\Framework\Pricing\PriceCurrencyInterface $p
2829
* Calculates product price.
2930
*
3031
* @param array $ruleData
31-
* @param null $productData
32+
* @param array|null $productData
3233
* @return float
3334
*/
3435
public function calculate($ruleData, $productData = null)
@@ -56,6 +57,6 @@ public function calculate($ruleData, $productData = null)
5657
$productPrice = 0;
5758
}
5859

59-
return $this->priceCurrency->round($productPrice);
60+
return $this->priceCurrency->roundPrice($productPrice, 4);
6061
}
6162
}

app/code/Magento/CatalogRule/Pricing/Price/CatalogRulePrice.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@
1818
use Magento\Store\Model\StoreManagerInterface;
1919

2020
/**
21-
* Class CatalogRulePrice
22-
*
2321
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
2422
*/
2523
class CatalogRulePrice extends AbstractPrice implements BasePriceProviderInterface
2624
{
2725
/**
2826
* Price type identifier string
2927
*/
30-
const PRICE_CODE = 'catalog_rule_price';
28+
public const PRICE_CODE = 'catalog_rule_price';
3129

3230
/**
3331
* @var TimezoneInterface
@@ -97,7 +95,7 @@ public function getValue()
9795
$this->value = $this->value ? (float)$this->value : false;
9896
}
9997
if ($this->value) {
100-
$this->value = $this->priceCurrency->convertAndRound($this->value);
98+
$this->value = $this->priceCurrency->convertAndRound($this->value, null, null, 4);
10199
}
102100
}
103101

app/code/Magento/CatalogRule/Test/Unit/Model/Indexer/ProductPriceCalculatorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
declare(strict_types=1);
77

8-
98
namespace Magento\CatalogRule\Test\Unit\Model\Indexer;
109

1110
use Magento\CatalogRule\Model\Indexer\ProductPriceCalculator;
@@ -29,6 +28,7 @@ protected function setUp(): void
2928
{
3029
$this->priceCurrencyMock = $this->getMockBuilder(PriceCurrencyInterface::class)
3130
->disableOriginalConstructor()
31+
->addMethods(['roundPrice'])
3232
->getMockForAbstractClass();
3333
$this->model = new ProductPriceCalculator($this->priceCurrencyMock);
3434
}
@@ -44,8 +44,8 @@ public function testCalculateToFixedPrice()
4444
$productData = ['rule_price' => $rulePrice];
4545

4646
$this->priceCurrencyMock->expects($this->once())
47-
->method('round')
48-
->with($actionAmount)
47+
->method('roundPrice')
48+
->with($actionAmount, 4)
4949
->willReturn($actionAmount);
5050

5151
$this->assertEquals($actionAmount, $this->model->calculate($ruleData, $productData));
@@ -63,8 +63,8 @@ public function testCalculateToPercentPrice()
6363
$productData = ['rule_price' => $rulePrice];
6464

6565
$this->priceCurrencyMock->expects($this->once())
66-
->method('round')
67-
->with($expectedPrice)
66+
->method('roundPrice')
67+
->with($expectedPrice, 4)
6868
->willReturn($expectedPrice);
6969

7070
$this->assertEquals($expectedPrice, $this->model->calculate($ruleData, $productData));
@@ -82,8 +82,8 @@ public function testCalculateByFixedPrice()
8282
$productData = ['rule_price' => $rulePrice];
8383

8484
$this->priceCurrencyMock->expects($this->once())
85-
->method('round')
86-
->with($expectedPrice)
85+
->method('roundPrice')
86+
->with($expectedPrice, 4)
8787
->willReturn($expectedPrice);
8888

8989
$this->assertEquals($expectedPrice, $this->model->calculate($ruleData, $productData));
@@ -101,8 +101,8 @@ public function testCalculateByPercentPrice()
101101
$productData = ['rule_price' => $rulePrice];
102102

103103
$this->priceCurrencyMock->expects($this->once())
104-
->method('round')
105-
->with($expectedPrice)
104+
->method('roundPrice')
105+
->with($expectedPrice, 4)
106106
->willReturn($expectedPrice);
107107

108108
$this->assertEquals($expectedPrice, $this->model->calculate($ruleData, $productData));

0 commit comments

Comments
 (0)