Skip to content

Commit a475162

Browse files
committed
Merge remote-tracking branch 'trigger/34812' into ph-delivery
2 parents 4b7c878 + 4c8f332 commit a475162

File tree

6 files changed

+20
-33
lines changed

6 files changed

+20
-33
lines changed

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

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Bundle\Pricing\Price;
88

99
use Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface;
10-
use Magento\Catalog\Model\Product;
1110
use Magento\Framework\Pricing\Amount\AmountInterface;
1211
use Magento\Catalog\Pricing\Price\CustomOptionPrice;
1312
use Magento\Bundle\Model\Product\Price;
@@ -27,36 +26,22 @@ class BundleRegularPrice extends \Magento\Catalog\Pricing\Price\RegularPrice imp
2726
*/
2827
protected $maximalPrice;
2928

30-
/**
31-
* @param Product $saleableItem
32-
* @param float $quantity
33-
* @param BundleCalculatorInterface $calculator
34-
* @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
35-
*/
36-
public function __construct(
37-
Product $saleableItem,
38-
$quantity,
39-
BundleCalculatorInterface $calculator,
40-
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
41-
) {
42-
parent::__construct($saleableItem, $quantity, $calculator, $priceCurrency);
43-
}
44-
4529
/**
4630
* @inheritdoc
4731
*/
4832
public function getAmount()
4933
{
50-
if (!isset($this->amount[$this->getValue()])) {
51-
$price = $this->getValue();
34+
$price = $this->getValue();
35+
$valueIndex = (string) $price;
36+
if (!isset($this->amount[$valueIndex])) {
5237
if ($this->product->getPriceType() == Price::PRICE_TYPE_FIXED) {
5338
/** @var \Magento\Catalog\Pricing\Price\CustomOptionPrice $customOptionPrice */
5439
$customOptionPrice = $this->priceInfo->getPrice(CustomOptionPrice::PRICE_CODE);
5540
$price += $customOptionPrice->getCustomOptionRange(true, $this->getPriceCode());
5641
}
57-
$this->amount[$this->getValue()] = $this->calculator->getMinRegularAmount($price, $this->product);
42+
$this->amount[$valueIndex] = $this->calculator->getMinRegularAmount($price, $this->product);
5843
}
59-
return $this->amount[$this->getValue()];
44+
return $this->amount[$valueIndex];
6045
}
6146

6247
/**

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
</argument>
7373
</arguments>
7474
</type>
75+
<type name="Magento\Bundle\Pricing\Price\BundleRegularPrice">
76+
<arguments>
77+
<argument name="calculator" xsi:type="object">Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface</argument>
78+
</arguments>
79+
</type>
7580
<type name="Magento\Bundle\Pricing\Price\FinalPrice">
7681
<arguments>
7782
<argument name="calculator" xsi:type="object">Magento\Bundle\Pricing\Adjustment\BundleCalculatorInterface</argument>

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt
4040
/**
4141
* Possible customer address types
4242
*/
43-
const TYPE_BILLING = 'billing';
43+
public const TYPE_BILLING = 'billing';
4444

45-
const TYPE_SHIPPING = 'shipping';
45+
public const TYPE_SHIPPING = 'shipping';
4646

4747
/**
4848
* Prefix of model events
@@ -73,8 +73,6 @@ class AbstractAddress extends AbstractExtensibleModel implements AddressModelInt
7373
protected static $_regionModels = [];
7474

7575
/**
76-
* Directory data
77-
*
7876
* @var \Magento\Directory\Helper\Data
7977
*/
8078
protected $_directoryData = null;
@@ -241,7 +239,7 @@ public function getStreetLine($number)
241239
public function getStreetFull()
242240
{
243241
$street = $this->getData('street');
244-
return is_array($street) ? implode("\n", $street) : $street;
242+
return is_array($street) ? implode("\n", $street) : ($street ?? '');
245243
}
246244

247245
/**

app/code/Magento/Widget/Controller/Adminhtml/Widget/Index.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
@@ -13,11 +12,9 @@ class Index extends \Magento\Backend\App\Action implements HttpPostActionInterfa
1312
/**
1413
* Authorization level of a basic admin session
1514
*/
16-
const ADMIN_RESOURCE = 'Magento_Widget::widget_instance';
15+
public const ADMIN_RESOURCE = 'Magento_Widget::widget_instance';
1716

1817
/**
19-
* Core registry
20-
*
2118
* @var \Magento\Framework\Registry
2219
*/
2320
protected $_coreRegistry;
@@ -50,11 +47,11 @@ public function __construct(
5047
public function execute()
5148
{
5249
// save extra params for widgets insertion form
53-
$skipped = $this->getRequest()->getParam('skip_widgets');
50+
$skipped = $this->getRequest()->getParam('skip_widgets', '');
5451
$skipped = $this->_widgetConfig->decodeWidgetsFromQuery($skipped);
55-
5652
$this->_coreRegistry->register('skip_widgets', $skipped);
5753

54+
// phpcs:ignore Magento2.Legacy.ObsoleteResponse
5855
$this->_view->loadLayout('empty')->renderLayout();
5956
}
6057
}

dev/tests/integration/testsuite/Magento/Shipping/Block/Adminhtml/Order/AddToPackageTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public function testGetCommentsHtml(): void
7575
*
7676
* @magentoDataFixture Magento/Shipping/_files/shipping_with_carrier_data_different_currency_code.php
7777
*/
78-
public function testGetCurrencyCodeCustomValue ()
78+
public function testGetCurrencyCodeCustomValue()
7979
{
8080
$template = '/<span class="customs-value-currency">\s*?(?<currency>[A-Za-z]+)\s*?<\/span>/';
8181
$matches = [];
8282
preg_match($template, $this->getHtml(), $matches);
8383
$currency = $matches['currency'] ?? null;
84-
$this->assertEquals('FR',$currency );
84+
$this->assertEquals('FR', $currency);
8585
}
8686

8787
/**
@@ -102,6 +102,7 @@ private function getHtml()
102102
$this->registry->register('current_shipment', $shipment);
103103

104104
$block->setTemplate('Magento_Shipping::order/packaging/popup.phtml');
105+
$block->setNameInLayout('test');
105106

106107
return $block->toHtml();
107108
}

dev/tests/integration/testsuite/Magento/User/Block/User/Edit/Tab/MainTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ protected function setUp(): void
2828

2929
$this->_block = $objectManager->create(\Magento\User\Block\User\Edit\Tab\Main::class);
3030
$this->_block->setArea('adminhtml');
31+
$this->_block->setNameInLayout('test');
3132
$this->_user = $objectManager->create(\Magento\User\Model\User::class);
3233

3334
$objectManager->get(\Magento\Framework\Registry::class)->register('permissions_user', $this->_user);

0 commit comments

Comments
 (0)