Skip to content

Commit b0c0764

Browse files
authored
Merge branch '2.4-develop' into fix-for-issue-39905
2 parents 450ce29 + 6e13440 commit b0c0764

File tree

54 files changed

+902
-318
lines changed

Some content is hidden

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

54 files changed

+902
-318
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testGetAmount()
9898
->willReturn($expectedResult);
9999

100100
$this->priceCurrencyMock->expects($this->once())
101-
->method('convertAndRound')
101+
->method('convert')
102102
->willReturnArgument(0);
103103

104104
$result = $this->regularPrice->getAmount();
@@ -123,7 +123,7 @@ public function testGetMaximalPrice()
123123
->willReturn($expectedResult);
124124

125125
$this->priceCurrencyMock->expects($this->once())
126-
->method('convertAndRound')
126+
->method('convert')
127127
->willReturnArgument(0);
128128

129129
$result = $this->regularPrice->getMaximalPrice();
@@ -165,7 +165,7 @@ public function testGetMaximalPriceForFixedPriceBundleWithOption()
165165
->willReturn($expectedPrice);
166166

167167
$this->priceCurrencyMock->expects($this->once())
168-
->method('convertAndRound')
168+
->method('convert')
169169
->willReturnArgument(0);
170170

171171
$result = $this->regularPrice->getMaximalPrice();
@@ -185,7 +185,7 @@ public function testGetMinimalPrice()
185185
->willReturn($expectedResult);
186186

187187
$this->priceCurrencyMock->expects($this->once())
188-
->method('convertAndRound')
188+
->method('convert')
189189
->willReturnArgument(0);
190190

191191
$this->bundleCalculatorMock->expects($this->once())
@@ -226,7 +226,7 @@ public function testGetMinimalPriceForFixedPricedBundleWithOptions()
226226
->willReturn($minOptionPrice);
227227

228228
$this->priceCurrencyMock->expects($this->once())
229-
->method('convertAndRound')
229+
->method('convert')
230230
->willReturnArgument(0);
231231

232232
$this->bundleCalculatorMock->expects($this->once())

app/code/Magento/Catalog/Pricing/Price/RegularPrice.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
use Magento\Framework\Pricing\Price\BasePriceProviderInterface;
1111

1212
/**
13-
* Class RegularPrice
13+
* Regular Price model
1414
*/
1515
class RegularPrice extends AbstractPrice implements BasePriceProviderInterface
1616
{
1717
/**
1818
* Price type
1919
*/
20-
const PRICE_CODE = 'regular_price';
20+
public const PRICE_CODE = 'regular_price';
2121

2222
/**
2323
* Get price value
@@ -28,7 +28,7 @@ public function getValue()
2828
{
2929
if ($this->value === null) {
3030
$price = $this->product->getPrice();
31-
$priceInCurrentCurrency = $this->priceCurrency->convertAndRound($price);
31+
$priceInCurrentCurrency = $this->priceCurrency->convert($price);
3232
$this->value = $priceInCurrentCurrency ? (float)$priceInCurrentCurrency : 0;
3333
}
3434
return $this->value;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<element name="asLowAsLabel" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][1]"/>
3737
<element name="asLowAsLabelAgain" type="input" selector="//strong[@id='block-related-heading']/following::span[@class='price-label'][2]"/>
3838
<element name="specialPriceValue" type="text" selector="//span[@class='special-price']//span[@class='price']"/>
39-
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]"/>
39+
<element name="mapPrice" type="text" selector="//div[@class='price-box price-final_price']//span[contains(@class, 'price-msrp_price')]//span"/>
4040
<element name="clickForPriceLink" type="text" selector="//div[@class='price-box price-final_price']//a[contains(text(), 'Click for price')]"/>
4141
<element name="addReviewLink" type="text" selector="//div[@class='reviews-actions']//a[@class='action add']"/>
4242
<element name="fptPrice" type="text" selector=".//*[@class='weee']/span"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<argument name="currency" value="EUR"/>
6262
</actionGroup>
6363
<actionGroup ref="AssertStorefrontCustomOptionCheckboxByPriceActionGroup" stepKey="checkPriceProductOptionEUR">
64-
<argument name="price" value="8.7"/>
64+
<argument name="price" value="8.69"/>
6565
</actionGroup>
6666
</test>
6767
</tests>

app/code/Magento/Catalog/Test/Unit/Block/Widget/LinkTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,17 @@ public function testStoreCodeShouldBeIncludedInURLOnlyIfItIsConfiguredSo(
195195
[
196196
[Store::XML_PATH_USE_REWRITES, ReinitableConfigInterface::SCOPE_TYPE_DEFAULT, null, true],
197197
[Store::XML_PATH_UNSECURE_BASE_LINK_URL, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, ''],
198+
]
199+
);
200+
$config->expects($this->any())
201+
->method('isSetFlag')
202+
->willReturnMap(
203+
[
198204
[
199205
Store::XML_PATH_STORE_IN_URL,
200206
ReinitableConfigInterface::SCOPE_TYPE_DEFAULT,
201-
null, $includeStoreCode
207+
null,
208+
$includeStoreCode
202209
]
203210
]
204211
);

app/code/Magento/Catalog/Test/Unit/Pricing/Price/RegularPriceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testGetValue($price)
8080
->method('getPrice')
8181
->willReturn($price);
8282
$this->priceCurrencyMock->expects($this->any())
83-
->method('convertAndRound')
83+
->method('convert')
8484
->with($price)
8585
->willReturn($convertedPrice);
8686
$this->assertEquals($convertedPrice, $this->regularPrice->getValue());
@@ -114,7 +114,7 @@ public function testGetAmount()
114114
->method('getPrice')
115115
->willReturn($priceValue);
116116
$this->priceCurrencyMock->expects($this->any())
117-
->method('convertAndRound')
117+
->method('convert')
118118
->with($priceValue)
119119
->willReturn($convertedPrice);
120120
$this->calculatorMock->expects($this->once())

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontConfigurableProductViewTest/StorefrontConfigurableProductMSRPCovertTest.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
3+
/**
4+
* Copyright 2020 Adobe
5+
* All Rights Reserved.
6+
*/
77
-->
8+
89
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
910
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1011
<test name="StorefrontConfigurableProductMSRPCovertTest">
@@ -112,6 +113,7 @@
112113
</actionGroup>
113114

114115
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="$$getConfigAttributeOption1.value$$" stepKey="selectFirstOption"/>
116+
<waitForAjaxLoad stepKey="waitForAjaxload"/>
115117
<waitForElement selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="waitForLoad"/>
116118
<grabTextFrom selector="{{StorefrontProductInfoMainSection.mapPrice}}" stepKey="grabProductMapPrice"/>
117119
<assertNotEquals stepKey="assertProductMapPrice">

app/code/Magento/Contact/view/frontend/templates/form.phtml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
// phpcs:disable Magento2.Templates.ThisInTemplate
88
// phpcs:disable Generic.Files.LineLength.TooLong
99

1010
/** @var \Magento\Contact\Block\ContactForm $block */
11-
if (!$block->getButtonLockManager()) {
12-
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
13-
$block->setButtonLockManager(
14-
$objectManager->get(\Magento\Framework\View\Element\ButtonLockManager::class)
15-
);
16-
}
11+
/** @var \Magento\Framework\View\Element\ButtonLockManager|null $buttonLockManager */
12+
$buttonLockManager = $block->getData('button_lock_manager');
1713
/** @var $escaper \Magento\Framework\Escaper */
1814
/** @var \Magento\Contact\ViewModel\UserDataProvider $viewModel */
1915

@@ -89,7 +85,7 @@ $viewModel = $block->getViewModel();
8985
<input type="hidden" name="hideit" id="hideit" value="" />
9086
<button type="submit" title="<?= $escaper->escapeHtmlAttr(__('Submit')) ?>" class="action submit primary"
9187
id="send2"
92-
<?php if ($block->getButtonLockManager()->isDisabled('contact_us_form_submit')): ?>
88+
<?php if ($buttonLockManager?->isDisabled('contact_us_form_submit')): ?>
9389
disabled="disabled"
9490
<?php endif; ?>>
9591
<span><?= $escaper->escapeHtml(__('Submit')) ?></span>

app/code/Magento/Customer/view/frontend/templates/form/edit.phtml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2011 Adobe
4+
* All Rights Reserved.
55
*/
66

77
use Magento\Customer\Block\Widget\Name;
88

99
/** @var \Magento\Customer\Block\Form\Edit $block */
10-
if (!$block->getButtonLockManager()) {
11-
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
12-
$block->setButtonLockManager(
13-
$objectManager->get(\Magento\Framework\View\Element\ButtonLockManager::class)
14-
);
15-
}
10+
/** @var \Magento\Framework\View\Element\ButtonLockManager|null $buttonLockManager */
11+
$buttonLockManager = $block->getData('button_lock_manager');
1612
/** @var $escaper \Magento\Framework\Escaper */
1713
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
1814
?>
@@ -123,7 +119,7 @@ if (!$block->getButtonLockManager()) {
123119
<div class="actions-toolbar">
124120
<div class="primary">
125121
<button type="submit" class="action save primary" title="<?= $escaper->escapeHtmlAttr(__('Save')) ?>"
126-
<?php if ($block->getButtonLockManager()->isDisabled('customer_edit_form_submit')): ?>
122+
<?php if ($buttonLockManager?->isDisabled('customer_edit_form_submit')): ?>
127123
disabled="disabled"
128124
<?php endif; ?>>
129125
<span><?= $escaper->escapeHtml(__('Save')) ?></span>

app/code/Magento/Customer/view/frontend/templates/form/forgotpassword.phtml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@
99
// phpcs:disable Generic.Files.LineLength.TooLong
1010

1111
/** @var \Magento\Customer\Block\Account\Forgotpassword $block */
12-
if (!$block->getButtonLockManager()) {
13-
// phpcs:ignore
14-
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
15-
$block->setButtonLockManager(
16-
$objectManager->get(\Magento\Framework\View\Element\ButtonLockManager::class)
17-
);
18-
}
12+
/** @var \Magento\Framework\View\Element\ButtonLockManager|null $buttonLockManager */
13+
$buttonLockManager = $block->getData('button_lock_manager');
1914
/** @var $escaper \Magento\Framework\Escaper */
2015
?>
2116
<form class="form password forget"
@@ -35,7 +30,7 @@ if (!$block->getButtonLockManager()) {
3530
</fieldset>
3631
<div class="actions-toolbar">
3732
<div class="primary">
38-
<button type="submit" class="action submit primary" id="send2" <?php if ($block->getButtonLockManager()->isDisabled('customer_forgot_password_form_submit')): ?> disabled="disabled" <?php endif; ?>><span><?= $escaper->escapeHtml(__('Reset My Password')) ?></span></button>
33+
<button type="submit" class="action submit primary" id="send2" <?php if ($buttonLockManager?->isDisabled('customer_forgot_password_form_submit')): ?> disabled="disabled" <?php endif; ?>><span><?= $escaper->escapeHtml(__('Reset My Password')) ?></span></button>
3934
</div>
4035
<div class="secondary">
4136
<a class="action back" href="<?= $escaper->escapeUrl($block->getLoginUrl()) ?>"><span><?= $escaper->escapeHtml(__('Go back')) ?></span></a>

0 commit comments

Comments
 (0)