Skip to content

Commit 60b092d

Browse files
committed
Merge branch '2.4-develop' of https://github.com/magento-l3/magento2ce into ACP2E-2224
� Conflicts: � app/code/Magento/Catalog/etc/di.xml
2 parents 2a3c989 + 87d2563 commit 60b092d

File tree

202 files changed

+4873
-2213
lines changed

Some content is hidden

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

202 files changed

+4873
-2213
lines changed

app/code/Magento/AwsS3/Test/Mftf/Test/AdminAwsS3SyncZeroByteFilesTest.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
<!-- Disable AWS S3 Remote Storage -->
4545
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
4646
</after>
47-
<magentoCLI command="remote-storage:sync" timeout="120" stepKey="syncRemoteStorage"/>
48-
<assertEquals stepKey="assertConfigTest">
49-
<expectedResult type="string">Uploading media files to remote storage.\n- empty.jpg\nEnd of upload.</expectedResult>
47+
<magentoCLI command="remote-storage:sync" timeout="200" stepKey="syncRemoteStorage"/>
48+
<comment userInput="checking remote-storage:sync" stepKey="assertConfigTest"/>
49+
<assertStringContainsString stepKey="checkingRemoteStorageSync">
50+
<expectedResult type="string">Uploading media files to remote storage</expectedResult>
5051
<actualResult type="variable">$syncRemoteStorage</actualResult>
51-
</assertEquals>
52-
52+
</assertStringContainsString>
5353
</test>
5454
</tests>

app/code/Magento/Backend/Model/Menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function add(Item $item, $parentId = null, $index = null)
8686
$index = (int) $index;
8787
if (!isset($this[$index])) {
8888
$this->offsetSet($index, $item);
89-
$this->_logger->info(
89+
$this->_logger->debug(
9090
sprintf('Add of item with id %s was processed', $item->getId())
9191
);
9292
} else {
@@ -151,7 +151,7 @@ public function remove($itemId)
151151
if ($item->getId() == $itemId) {
152152
unset($this[$key]);
153153
$result = true;
154-
$this->_logger->info(
154+
$this->_logger->debug(
155155
sprintf('Remove on item with id %s was processed', $item->getId())
156156
);
157157
break;

app/code/Magento/Backend/Model/Menu/Director/Director.php

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

77
namespace Magento\Backend\Model\Menu\Director;
88

9+
use Magento\Backend\Model\Menu\Builder;
10+
use Magento\Backend\Model\Menu\Builder\AbstractCommand;
11+
use Psr\Log\LoggerInterface;
12+
913
/**
1014
* @api
1115
* @since 100.0.2
@@ -23,14 +27,14 @@ class Director extends \Magento\Backend\Model\Menu\AbstractDirector
2327
* Get command object
2428
*
2529
* @param array $data command params
26-
* @param \Psr\Log\LoggerInterface $logger
27-
* @return \Magento\Backend\Model\Menu\Builder\AbstractCommand
30+
* @param LoggerInterface $logger
31+
* @return AbstractCommand
2832
*/
2933
protected function _getCommand($data, $logger)
3034
{
3135
$command = $this->_commandFactory->create($data['type'], ['data' => $data]);
3236
if (isset($this->_messagePatterns[$data['type']])) {
33-
$logger->info(
37+
$logger->debug(
3438
sprintf($this->_messagePatterns[$data['type']], $command->getId())
3539
);
3640
}
@@ -41,14 +45,14 @@ protected function _getCommand($data, $logger)
4145
* Build menu instance
4246
*
4347
* @param array $config
44-
* @param \Magento\Backend\Model\Menu\Builder $builder
45-
* @param \Psr\Log\LoggerInterface $logger
48+
* @param Builder $builder
49+
* @param LoggerInterface $logger
4650
* @return void
4751
*/
4852
public function direct(
4953
array $config,
50-
\Magento\Backend\Model\Menu\Builder $builder,
51-
\Psr\Log\LoggerInterface $logger
54+
Builder $builder,
55+
LoggerInterface $logger
5256
) {
5357
foreach ($config as $data) {
5458
$builder->processCommand($this->_getCommand($data, $logger));

app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ public function getNewEmptyItem()
316316
public function addPriceFilter($product, $searchMin, $useRegularPrice = false)
317317
{
318318
if ($product->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC) {
319+
if (!$this->getStoreId()) {
320+
$this->setStoreId($this->_storeManager->getStore()->getId());
321+
}
319322
$this->addPriceData();
320323
if ($useRegularPrice) {
321324
$minimalPriceExpression = self::INDEX_TABLE_ALIAS . '.price';

app/code/Magento/Bundle/Pricing/Price/BundleSelectionPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function getValue()
140140
if (!$this->useRegularPrice) {
141141
$value = $this->discountCalculator->calculateDiscount($this->bundleProduct, $value);
142142
}
143-
$this->value = $this->priceCurrency->round($value);
143+
$this->value = $this->priceCurrency->roundPrice($value, 4);
144144
$product->setData($bundleSelectionKey, $this->value);
145145

146146
return $this->value;

app/code/Magento/Bundle/Pricing/Price/SpecialPrice.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getValue()
4343
}
4444

4545
$specialPrice = $this->getDiscountPercent();
46-
if ($specialPrice) {
46+
if ($specialPrice !== false) {
4747
$regularPrice = $this->getRegularPrice();
4848
$this->value = $regularPrice * ($specialPrice / 100);
4949
} else {
@@ -63,6 +63,8 @@ protected function getRegularPrice()
6363
}
6464

6565
/**
66+
* Returns true as special price is always percentage for bundle products
67+
*
6668
* @return bool
6769
*/
6870
public function isPercentageDiscount()

app/code/Magento/Bundle/Test/Unit/Pricing/Price/BundleSelectionPriceTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ protected function setUp(): void
106106
$this->productMock->expects($this->atLeastOnce())
107107
->method('getPriceInfo')
108108
->willReturn($this->priceInfoMock);
109-
110-
$this->priceCurrencyMock = $this->getMockForAbstractClass(PriceCurrencyInterface::class);
111-
109+
110+
$this->priceCurrencyMock = $this->getMockBuilder(PriceCurrencyInterface::class)
111+
->disableOriginalConstructor()
112+
->addMethods(['roundPrice'])
113+
->getMockForAbstractClass();
114+
112115
$this->quantity = 1;
113116

114117
$this->setupSelectionPrice();
@@ -169,7 +172,7 @@ public function testGetValueTypeDynamic($useRegularPrice)
169172
}
170173

171174
$this->priceCurrencyMock->expects($this->once())
172-
->method('round')
175+
->method('roundPrice')
173176
->with($actualPrice)
174177
->willReturn($expectedPrice);
175178

@@ -234,7 +237,7 @@ public function testGetValueTypeFixedWithSelectionPriceType(bool $useRegularPric
234237
}
235238

236239
$this->priceCurrencyMock->expects($this->once())
237-
->method('round')
240+
->method('roundPrice')
238241
->with($actualPrice)
239242
->willReturn($expectedPrice);
240243

@@ -282,7 +285,7 @@ public function testGetValueTypeFixedWithoutSelectionPriceType($useRegularPrice)
282285
}
283286

284287
$this->priceCurrencyMock->expects($this->once())
285-
->method('round')
288+
->method('roundPrice')
286289
->with($actualPrice)
287290
->willReturn($expectedPrice);
288291

@@ -343,7 +346,7 @@ public function testFixedPriceWithMultipleQty($useRegularPrice)
343346
}
344347

345348
$this->priceCurrencyMock->expects($this->once())
346-
->method('round')
349+
->method('roundPrice')
347350
->with($actualPrice)
348351
->willReturn($expectedPrice);
349352

@@ -405,7 +408,7 @@ public function testGetAmount()
405408
->willReturn($price);
406409

407410
$this->priceCurrencyMock->expects($this->once())
408-
->method('round')
411+
->method('roundPrice')
409412
->with($price)
410413
->willReturn($price);
411414

app/code/Magento/Bundle/Test/Unit/Pricing/Price/SpecialPriceTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ public function getValueDataProvider()
135135
'percent' => 40],
136136
['regularPrice' => 75, 'specialPrice' => 40, 'isScopeDateInInterval' => false, 'value' => false,
137137
'percent' => null],
138+
['regularPrice' => 100, 'specialPrice' => 0, 'isScopeDateInInterval' => true, 'value' => 0,
139+
'percent' => 0],
138140
];
139141
}
140142
}

app/code/Magento/BundleGraphQl/Model/Cart/BuyRequest/BundleDataProvider.php

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

88
namespace Magento\BundleGraphQl\Model\Cart\BuyRequest;
99

10+
use Magento\Framework\App\ObjectManager;
1011
use Magento\Framework\Stdlib\ArrayManager;
12+
use Magento\Framework\Stdlib\ArrayManagerFactory;
1113
use Magento\QuoteGraphQl\Model\Cart\BuyRequest\BuyRequestDataProviderInterface;
1214

1315
/**
@@ -16,17 +18,23 @@
1618
class BundleDataProvider implements BuyRequestDataProviderInterface
1719
{
1820
/**
19-
* @var ArrayManager
21+
* @var ArrayManagerFactory
22+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
2023
*/
21-
private $arrayManager;
24+
private readonly ArrayManagerFactory $arrayManagerFactory;
2225

2326
/**
24-
* @param ArrayManager $arrayManager
27+
* @param ArrayManager $arrayManager @deprecated @see $arrayManagerFactory
28+
* @param ArrayManagerFactory|null $arrayManagerFactory
29+
*
30+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2531
*/
2632
public function __construct(
27-
ArrayManager $arrayManager
33+
ArrayManager $arrayManager,
34+
?ArrayManagerFactory $arrayManagerFactory = null,
2835
) {
29-
$this->arrayManager = $arrayManager;
36+
$this->arrayManagerFactory = $arrayManagerFactory
37+
?? ObjectManager::getInstance()->get(ArrayManagerFactory::class);
3038
}
3139

3240
/**
@@ -35,7 +43,7 @@ public function __construct(
3543
public function execute(array $cartItemData): array
3644
{
3745
$bundleOptions = [];
38-
$bundleInputs = $this->arrayManager->get('bundle_options', $cartItemData) ?? [];
46+
$bundleInputs = $this->arrayManagerFactory->create()->get('bundle_options', $cartItemData) ?? [];
3947
foreach ($bundleInputs as $bundleInput) {
4048
$bundleOptions['bundle_option'][$bundleInput['id']] = $bundleInput['value'];
4149
$bundleOptions['bundle_option_qty'][$bundleInput['id']] = $bundleInput['quantity'];

0 commit comments

Comments
 (0)