Skip to content

Commit a2c5e93

Browse files
committed
Merge remote-tracking branch 'mainline/2.4.2-develop' into issue-29302-graphql-schema-change
2 parents bb1ac61 + 5cc7163 commit a2c5e93

File tree

247 files changed

+38346
-33005
lines changed

Some content is hidden

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

247 files changed

+38346
-33005
lines changed

app/code/Magento/AsynchronousOperations/etc/db_schema.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<index referenceId="MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID" indexType="btree">
3131
<column name="user_id"/>
3232
</index>
33+
<index referenceId="MAGENTO_BULK_START_TIME" indexType="btree">
34+
<column name="start_time"/>
35+
</index>
3336
</table>
3437
<table name="magento_operation" resource="default" engine="innodb" comment="Operation entity">
3538
<column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"

app/code/Magento/AsynchronousOperations/etc/db_schema_whitelist.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"index": {
1313
"MAGENTO_BULK_USER_ID_ADMIN_USER_USER_ID": true,
14-
"MAGENTO_BULK_USER_ID": true
14+
"MAGENTO_BULK_USER_ID": true,
15+
"MAGENTO_BULK_START_TIME": true
1516
},
1617
"constraint": {
1718
"PRIMARY": true,

app/code/Magento/AwsS3/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"require": {
88
"php": "~7.3.0||~7.4.0",
9-
"magento/framework": "^100.0.2",
9+
"magento/framework": "*",
1010
"magento/module-remote-storage": "*",
1111
"league/flysystem": "^1.0",
1212
"league/flysystem-aws-s3-v3": "^1.0",

app/code/Magento/Backend/Block/Store/Switcher.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,17 @@ public function hasScopeSelected()
449449
*/
450450
public function getCurrentSelectionName()
451451
{
452-
if (!($name = $this->getCurrentStoreName())) {
453-
if (!($name = $this->getCurrentStoreGroupName())) {
454-
if (!($name = $this->getCurrentWebsiteName())) {
455-
$name = $this->getDefaultSelectionName();
456-
}
457-
}
452+
if ($this->getCurrentStoreName() !== '') {
453+
return $this->getCurrentStoreName();
454+
}
455+
if ($this->getCurrentStoreGroupName() !== '') {
456+
return $this->getCurrentStoreGroupName();
458457
}
459-
return $name;
458+
459+
if ($this->getCurrentWebsiteName() !== '') {
460+
return $this->getCurrentWebsiteName();
461+
}
462+
return $this->getDefaultSelectionName();
460463
}
461464

462465
/**
@@ -473,6 +476,8 @@ public function getCurrentWebsiteName()
473476
return $website->getName();
474477
}
475478
}
479+
480+
return '';
476481
}
477482

478483
/**
@@ -489,6 +494,8 @@ public function getCurrentStoreGroupName()
489494
return $group->getName();
490495
}
491496
}
497+
498+
return '';
492499
}
493500

494501
/**
@@ -505,6 +512,8 @@ public function getCurrentStoreName()
505512
return $store->getName();
506513
}
507514
}
515+
516+
return '';
508517
}
509518

510519
/**
@@ -586,13 +595,11 @@ public function getHintHtml()
586595
$html = '';
587596
$url = $this->getHintUrl();
588597
if ($url) {
589-
$html = '<div class="admin__field-tooltip tooltip">' . '<a' . ' href="' . $this->escapeUrl(
590-
$url
591-
) . '"' . ' onclick="this.target=\'_blank\'"' . ' title="' . __(
592-
'What is this?'
593-
) . '"' . ' class="admin__field-tooltip-action action-help"><span>' . __(
594-
'What is this?'
595-
) . '</span></a>' . ' </div>';
598+
$html = '<div class="admin__field-tooltip tooltip"><a href="%s" onclick="this.target=\'_blank\'" title="%s"
599+
class="admin__field-tooltip-action action-help"><span>%s</span></a></span></div>';
600+
$title = $this->escapeHtmlAttr(__('What is this?'));
601+
$span= $this->escapeHtml(__('What is this?'));
602+
$html = sprintf($html, $this->escapeUrl($url), $title, $span);
596603
}
597604
return $html;
598605
}

app/code/Magento/Backend/Block/Widget.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
class Widget extends \Magento\Backend\Block\Template
1616
{
1717
/**
18+
* Get ID
19+
*
1820
* @return string
1921
*/
2022
public function getId()
@@ -37,6 +39,8 @@ public function getSuffixId($suffix)
3739
}
3840

3941
/**
42+
* Get HTML ID
43+
*
4044
* @return string
4145
*/
4246
public function getHtmlId()
@@ -59,6 +63,8 @@ public function getCurrentUrl($params = [])
5963
}
6064

6165
/**
66+
* Prepare Breadcrumbs
67+
*
6268
* @param string $label
6369
* @param string|null $title
6470
* @param string|null $link
@@ -84,7 +90,13 @@ public function getButtonHtml($label, $onclick, $class = '', $buttonId = null, $
8490
return $this->getLayout()->createBlock(
8591
\Magento\Backend\Block\Widget\Button::class
8692
)->setData(
87-
['label' => $label, 'onclick' => $onclick, 'class' => $class, 'type' => 'button', 'id' => $buttonId]
93+
[
94+
'label' => $label,
95+
'onclick' => $onclick,
96+
'class' => $class,
97+
'type' => 'button',
98+
'id' => $buttonId
99+
]
88100
)->setDataAttribute(
89101
$dataAttr
90102
)->toHtml();

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Backend\Model\Auth;
79

810
use Magento\Framework\App\ObjectManager;
@@ -210,7 +212,8 @@ public function prolong()
210212
->setPath($this->sessionConfig->getCookiePath())
211213
->setDomain($this->sessionConfig->getCookieDomain())
212214
->setSecure($this->sessionConfig->getCookieSecure())
213-
->setHttpOnly($this->sessionConfig->getCookieHttpOnly());
215+
->setHttpOnly($this->sessionConfig->getCookieHttpOnly())
216+
->setSameSite($this->sessionConfig->getCookieSameSite());
214217
$this->cookieManager->setPublicCookie($this->getName(), $cookieValue, $cookieMetadata);
215218
}
216219
}

app/code/Magento/Backend/Model/Session/AdminConfig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function __construct(
8585
$this->setCookiePath($adminPath);
8686
$this->setName($sessionName);
8787
$this->setCookieSecure($this->_httpRequest->isSecure());
88+
$this->setCookieSameSite('Lax');
8889
}
8990

9091
/**
@@ -96,6 +97,7 @@ private function extractAdminPath()
9697
{
9798
$backendApp = $this->backendAppList->getCurrentApp();
9899
$cookiePath = null;
100+
//phpcs:ignore
99101
$baseUrl = parse_url($this->backendUrlFactory->create()->getBaseUrl(), PHP_URL_PATH);
100102
if (!$backendApp) {
101103
$cookiePath = $baseUrl . $this->_frontNameResolver->getFrontName();

app/code/Magento/Backend/Test/Mftf/Test/AdminExpireCustomerSessionTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
<after>
2323
<!-- 6. Restore default configuration settings. -->
2424
<magentoCLI command="config:set {{DefaultWebCookieLifetimeConfigData.path}} {{DefaultWebCookieLifetimeConfigData.value}}" stepKey="setDefaultCookieLifetime"/>
25+
<!-- Customer Log Out -->
26+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/>
2527
<!-- Delete data -->
2628
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
2729
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>

app/code/Magento/Backend/Test/Unit/Model/Auth/SessionTest.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ protected function setUp(): void
8484
->getMock();
8585
$this->sessionConfig = $this->createPartialMock(
8686
\Magento\Framework\Session\Config::class,
87-
['getCookiePath', 'getCookieDomain', 'getCookieSecure', 'getCookieHttpOnly']
87+
[
88+
'getCookiePath',
89+
'getCookieDomain',
90+
'getCookieSecure',
91+
'getCookieHttpOnly',
92+
'getCookieSameSite'
93+
]
8894
);
8995
$this->aclBuilder = $this->getMockBuilder(Builder::class)
9096
->disableOriginalConstructor()
@@ -193,6 +199,9 @@ public function testProlong()
193199
$cookieMetadata->expects($this->once())
194200
->method('setHttpOnly')
195201
->with($httpOnly)->willReturnSelf();
202+
$cookieMetadata->expects($this->once())
203+
->method('setSameSite')
204+
->willReturnSelf();
196205

197206
$this->cookieMetadataFactory->expects($this->once())
198207
->method('createPublicCookieMetadata')
@@ -218,6 +227,9 @@ public function testProlong()
218227
$this->sessionConfig->expects($this->once())
219228
->method('getCookieHttpOnly')
220229
->willReturn($httpOnly);
230+
$this->sessionConfig->expects($this->once())
231+
->method('getCookieSameSite')
232+
->willReturn('Lax');
221233

222234
$this->session->prolong();
223235

@@ -247,7 +259,9 @@ public function testIsAllowed($isUserDefined, $isAclDefined, $isAllowed, $expect
247259
$this->storage->expects($this->once())->method('getUser')->willReturn($userMock);
248260
}
249261
if ($isAclDefined && $isUserDefined) {
262+
// phpstan:ignore
250263
$userMock->expects($this->any())->method('getAclRole')->willReturn($userAclRole);
264+
// phpstan:ignore
251265
$aclMock->expects($this->once())->method('isAllowed')->with($userAclRole)->willReturn($isAllowed);
252266
}
253267

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function getOptionHtml(Option $option)
222222
{
223223
$optionBlock = $this->getChildBlock($option->getType());
224224
if (!$optionBlock) {
225-
return __('There is no defined renderer for "%1" option type.', $option->getType());
225+
return __('There is no defined renderer for "%1" option type.', $this->escapeHtml($option->getType()));
226226
}
227227
return $optionBlock->setOption($option)->toHtml();
228228
}
@@ -411,15 +411,18 @@ private function processOptions(string $optionId, array $options, DataObject $pr
411411
{
412412
$preConfiguredQtys = $preConfiguredValues->getData("bundle_option_qty/${optionId}") ?? [];
413413
$selections = $options[$optionId]['selections'];
414-
array_walk($selections, function (&$selection, $selectionId) use ($preConfiguredQtys) {
415-
if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) {
416-
$selection['qty'] = $preConfiguredQtys[$selectionId];
417-
} else {
418-
if ((int)$preConfiguredQtys > 0) {
419-
$selection['qty'] = $preConfiguredQtys;
414+
array_walk(
415+
$selections,
416+
function (&$selection, $selectionId) use ($preConfiguredQtys) {
417+
if (is_array($preConfiguredQtys) && isset($preConfiguredQtys[$selectionId])) {
418+
$selection['qty'] = $preConfiguredQtys[$selectionId];
419+
} else {
420+
if ((int)$preConfiguredQtys > 0) {
421+
$selection['qty'] = $preConfiguredQtys;
422+
}
420423
}
421424
}
422-
});
425+
);
423426
$options[$optionId]['selections'] = $selections;
424427

425428
return $options;

0 commit comments

Comments
 (0)