Skip to content

Commit dbc97f9

Browse files
authored
Merge pull request #7842 from magento-amigos/2.4-develop-prs
[Amigos] Community Contributions - 2.4-develop
2 parents 7f5e674 + e2214b7 commit dbc97f9

File tree

21 files changed

+263
-39
lines changed

21 files changed

+263
-39
lines changed

app/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</div>
2828
HTML;
2929
}
30+
http_response_code(503);
3031
exit(1);
3132
}
3233

app/code/Magento/Authorization/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Magento_Authorization module enables management of access control list roles
44

55
## Installation details
66

7-
The Magento_AdminNotification module creates the following tables in the database:
7+
The Magento_Authorization module creates the following tables in the database using `db_schema.xml`:
88

99
- `authorization_role`
1010
- `authorization_rule`

app/code/Magento/CatalogSearch/Block/Plugin/FrontTabPlugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function beforeSetForm(ProductAttributeFrontTabBlock $subject, Form $form
4545
[
4646
'name' => 'search_weight',
4747
'label' => __('Search Weight'),
48+
'note' => __('10 is the highest priority/heaviest weighting.'),
4849
'values' => $this->weightSource->getOptions()
4950
],
5051
'is_searchable'

app/code/Magento/CatalogSearch/Test/Unit/Block/Plugin/FrontTabPluginTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function testBeforeSetForm()
111111
[
112112
'name' => 'search_weight',
113113
'label' => __('Search Weight'),
114+
'note' => __('10 is the highest priority/heaviest weighting.'),
114115
'values' => $weightOptions
115116
],
116117
'is_searchable',

app/code/Magento/Checkout/view/frontend/layout/checkout_index_index.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<item name="element" xsi:type="string">#opc-new-shipping-address</item>
9696
<item name="options" xsi:type="array">
9797
<item name="type" xsi:type="string">popup</item>
98+
<item name="modalClass" xsi:type="string">new-shipping-address-modal</item>
9899
<item name="responsive" xsi:type="boolean">true</item>
99100
<item name="innerScroll" xsi:type="boolean">true</item>
100101
<item name="title" xsi:type="string" translate="true">Shipping Address</item>

app/code/Magento/NewRelicReporting/Model/NewRelicWrapper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\NewRelicReporting\Model;
77

8-
use Exception;
8+
use Throwable;
99

1010
/**
1111
* Wrapper for New Relic functions
@@ -33,10 +33,10 @@ public function addCustomParameter($param, $value)
3333
/**
3434
* Wrapper for 'newrelic_notice_error' function
3535
*
36-
* @param Exception $exception
36+
* @param Throwable $exception
3737
* @return void
3838
*/
39-
public function reportError(Exception $exception)
39+
public function reportError(Throwable $exception)
4040
{
4141
if ($this->isExtensionInstalled()) {
4242
newrelic_notice_error($exception->getMessage(), $exception);

app/code/Magento/Shipping/Model/Shipping.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function collectRates(\Magento\Quote\Model\Quote\Address\RateRequest $req
273273
*/
274274
private function prepareCarrier(string $carrierCode, RateRequest $request): AbstractCarrier
275275
{
276-
$carrier = $this->isShippingCarrierAvailable($carrierCode)
276+
$carrier = $this->isShippingCarrierAvailable($carrierCode, $request->getStoreId())
277277
? $this->_carrierFactory->create($carrierCode, $request->getStoreId())
278278
: null;
279279
if (!$carrier) {
@@ -541,13 +541,15 @@ public function setCarrierAvailabilityConfigField($code = 'active')
541541
* Checks availability of carrier.
542542
*
543543
* @param string $carrierCode
544+
* @param null|int $storeId
544545
* @return bool
545546
*/
546-
private function isShippingCarrierAvailable(string $carrierCode): bool
547+
private function isShippingCarrierAvailable(string $carrierCode, ?int $storeId = null): bool
547548
{
548549
return $this->_scopeConfig->isSetFlag(
549550
'carriers/' . $carrierCode . '/' . $this->_availabilityConfigField,
550-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
551+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE,
552+
$storeId
551553
);
552554
}
553555
}

app/code/Magento/Theme/Block/Html/Header.php

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

77
namespace Magento\Theme\Block\Html;
88

9+
use Magento\Framework\Escaper;
10+
911
/**
1012
* Html page header block
1113
*
@@ -14,6 +16,27 @@
1416
*/
1517
class Header extends \Magento\Framework\View\Element\Template
1618
{
19+
/**
20+
* @var Escaper
21+
*/
22+
private $escaper;
23+
24+
/**
25+
* Constructor
26+
*
27+
* @param \Magento\Framework\View\Element\Template\Context $context
28+
* @param Magento\Framework\Escaper $escaper
29+
* @param array $data
30+
*/
31+
public function __construct(
32+
\Magento\Framework\View\Element\Template\Context $context,
33+
\Magento\Framework\Escaper $escaper,
34+
array $data = []
35+
) {
36+
$this->escaper = $escaper;
37+
parent::__construct($context, $data);
38+
}
39+
1740
/**
1841
* Current template name
1942
*
@@ -34,6 +57,7 @@ public function getWelcome()
3457
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
3558
);
3659
}
60+
$this->_data['welcome'] = $this->escaper->escapeQuote($this->_data['welcome'], true);
3761
return __($this->_data['welcome']);
3862
}
3963
}

app/code/Magento/Theme/Test/Unit/Block/Html/HeaderTest.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Magento\Theme\Block\Html\Header;
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
17+
use Magento\Framework\Escaper;
1718

1819
class HeaderTest extends TestCase
1920
{
@@ -27,6 +28,11 @@ class HeaderTest extends TestCase
2728
*/
2829
protected $scopeConfig;
2930

31+
/**
32+
* @var Escaper|MockObject
33+
*/
34+
private $escaper;
35+
3036
protected function setUp(): void
3137
{
3238
$context = $this->getMockBuilder(Context::class)
@@ -38,10 +44,13 @@ protected function setUp(): void
3844
->disableOriginalConstructor()
3945
->getMock();
4046
$context->expects($this->once())->method('getScopeConfig')->willReturn($this->scopeConfig);
41-
47+
$this->escaper = $this->createPartialMock(Escaper::class, ['escapeQuote']);
4248
$this->unit = (new ObjectManager($this))->getObject(
4349
Header::class,
44-
['context' => $context]
50+
[
51+
'context' => $context,
52+
'escaper' => $this->escaper
53+
]
4554
);
4655
}
4756

@@ -51,6 +60,11 @@ public function testGetWelcomeDefault()
5160
->with('design/header/welcome', ScopeInterface::SCOPE_STORE)
5261
->willReturn('Welcome Message');
5362

63+
$this->escaper->expects($this->once())
64+
->method('escapeQuote')
65+
->with('Welcome Message', true)
66+
->willReturn('Welcome Message');
67+
5468
$this->assertEquals('Welcome Message', $this->unit->getWelcome());
5569
}
5670
}

app/code/Magento/Theme/view/frontend/templates/html/header.phtml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,34 @@
1010
*/
1111
$welcomeMessage = $block->getWelcome();
1212
?>
13-
<?php if ($block->getShowPart() == 'welcome') : ?>
13+
<?php if ($block->getShowPart() == 'welcome'): ?>
1414
<li class="greet welcome" data-bind="scope: 'customer'">
1515
<!-- ko if: customer().fullname -->
1616
<span class="logged-in"
17-
data-bind="text: new String('<?= $escaper->escapeHtml(__('Welcome, %1!', '%1')) ?>').replace('%1', customer().fullname)">
17+
data-bind="text: new String('<?= $escaper->escapeHtml(__('Welcome, %1!', '%1')) ?>').
18+
replace('%1', customer().fullname)">
1819
</span>
1920
<!-- /ko -->
2021
<!-- ko ifnot: customer().fullname -->
2122
<span class="not-logged-in"
22-
data-bind="html: '<?= $escaper->escapeHtmlAttr($welcomeMessage) ?>'"></span>
23+
data-bind="text: '<?= $escaper->escapeHtml($welcomeMessage) ?>'"></span>
2324
<?= $block->getBlockHtml('header.additional') ?>
2425
<!-- /ko -->
2526
</li>
27+
<?php // phpcs:ignore Magento2.Legacy.PhtmlTemplate ?>
2628
<script type="text/x-magento-init">
27-
{
28-
"*": {
29-
"Magento_Ui/js/core/app": {
30-
"components": {
31-
"customer": {
32-
"component": "Magento_Customer/js/view/customer"
29+
{
30+
"*": {
31+
"Magento_Ui/js/core/app": {
32+
"components": {
33+
"customer": {
34+
"component": "Magento_Customer/js/view/customer"
35+
}
3336
}
3437
}
3538
}
3639
}
37-
}
3840
</script>
39-
<?php elseif ($block->getShowPart() == 'other') :?>
41+
<?php elseif ($block->getShowPart() == 'other'): ?>
4042
<?= $block->getChildHtml() ?>
4143
<?php endif ?>

0 commit comments

Comments
 (0)