Skip to content

Commit 5f13aba

Browse files
committed
Merge branch '2.4.0-changelog' of github.com:magento-engcom/magento2ce into 2.4.0-changelog
2 parents 9de0cf2 + eb03758 commit 5f13aba

File tree

30 files changed

+396
-450
lines changed

30 files changed

+396
-450
lines changed

app/code/Magento/AdminAnalytics/view/adminhtml/templates/notification.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $scriptString = <<<script
1818
releaseVisible: {$isReleaseVisible},
1919
}
2020
});
21-
script
21+
script;
2222
?>
2323

2424
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>

app/code/Magento/Backend/view/adminhtml/templates/widget/grid.phtml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ $numColumns = $block->getColumns() !== null ? count($block->getColumns()): 0;
101101
'onclick',
102102
/* @noEscape */ $block->getJsObjectName() . '.setPage(\'' .
103103
/* @noEscape */ ($_curPage - 1) . '\');event.preventDefault();',
104-
'button.action-previous'
104+
'div#' . $block->escapeJs($block->getId()) .
105+
' .admin__data-grid-pager button.action-previous:not(.disabled)'
105106
) ?>
106107
<?php else: ?>
107108
<button type="button" class="action-previous disabled">
@@ -137,7 +138,8 @@ $numColumns = $block->getColumns() !== null ? count($block->getColumns()): 0;
137138
'onclick',
138139
/* @noEscape */ $block->getJsObjectName() . '.setPage(\'' .
139140
/* @noEscape */ ($_curPage + 1) . '\');event.preventDefault();',
140-
'button.action-next'
141+
'div#' . $block->escapeJs($block->getId()) .
142+
' .admin__data-grid-pager button.action-next:not(.disabled)'
141143
) ?>
142144
<?php else: ?>
143145
<button type="button" class="action-next disabled">
@@ -186,8 +188,8 @@ $numColumns = $block->getColumns() !== null ? count($block->getColumns()): 0;
186188
$scriptString .= 'deps.push(\'mage/adminhtml/grid\');' . PHP_EOL;
187189

188190
$scriptString .= '
189-
require(deps, function('. ($block->getDependencyJsObject() ? 'registry' : '') .'){' . PHP_EOL .'
190-
//TODO: getJsObjectName and getRowClickCallback has unexpected behavior. Should be removed' . PHP_EOL;
191+
require(deps, function('. ($block->getDependencyJsObject() ? 'registry' : '') .'){' . PHP_EOL;
192+
//TODO: getJsObjectName and getRowClickCallback has unexpected behavior. Should be removed
191193
if ($block->getDependencyJsObject()) {
192194
$scriptString .= 'registry.get(\'' . $block->escapeJs($block->getDependencyJsObject()) .
193195
'\', function ('. $block->escapeJs($block->getDependencyJsObject()) . ') {' . PHP_EOL;

app/code/Magento/Backend/view/adminhtml/templates/widget/grid/extended.phtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ $numColumns = count($block->getColumns());
116116
'onclick',
117117
/* @noEscape */ $block->getJsObjectName() . '.setPage(\'' .
118118
/* @noEscape */ ($_curPage - 1) . '\');event.preventDefault();',
119-
'.admin__data-grid-pager button.action-previous'
119+
'div#' . $block->escapeJs($block->getId()) .
120+
' .admin__data-grid-pager button.action-previous:not(.disabled)'
120121
) ?>
121122
<?php else: ?>
122123
<button type="button" class="action-previous disabled">
@@ -150,7 +151,8 @@ $numColumns = count($block->getColumns());
150151
'onclick',
151152
/* @noEscape */ $block->getJsObjectName() . '.setPage(\'' .
152153
/* @noEscape */ ($_curPage + 1) . '\');event.preventDefault();',
153-
'.admin__data-grid-pager button.action-next'
154+
'div#' . $block->escapeJs($block->getId()) .
155+
' .admin__data-grid-pager button.action-next:not(.disabled)'
154156
) ?>
155157
<?php else: ?>
156158
<button type="button" class="action-next disabled">

app/code/Magento/Backup/Test/Mftf/ActionGroup/deleteBackupActionGroup.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/code/Magento/Catalog/view/frontend/templates/product/view/options/type/file.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@
7575
<?= $_fileExists ?
7676
/* @noEscape */ $secureRenderer->renderStyleAsTag(
7777
'display:none',
78-
'input-box-' . /* @noEscape */ $_fileName
78+
'#input-box-' . /* @noEscape */ $_fileName
7979
) : '' ?>
8080
</div>

app/code/Magento/Csp/etc/config.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@
7575
<styles>
7676
<policy_id>style-src</policy_id>
7777
<self>1</self>
78-
<inline>0</inline>
78+
<inline>1</inline>
7979
<eval>0</eval>
8080
<dynamic>0</dynamic>
8181
</styles>
8282
<scripts>
8383
<policy_id>script-src</policy_id>
8484
<self>1</self>
85-
<inline>0</inline>
85+
<inline>1</inline>
8686
<eval>1</eval>
8787
<dynamic>0</dynamic>
8888
</scripts>
@@ -180,14 +180,14 @@
180180
<styles>
181181
<policy_id>style-src</policy_id>
182182
<self>1</self>
183-
<inline>0</inline>
183+
<inline>1</inline>
184184
<eval>0</eval>
185185
<dynamic>0</dynamic>
186186
</styles>
187187
<scripts>
188188
<policy_id>script-src</policy_id>
189189
<self>1</self>
190-
<inline>0</inline>
190+
<inline>1</inline>
191191
<eval>1</eval>
192192
<dynamic>0</dynamic>
193193
</scripts>
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Customer\Setup\Patch\Data;
9+
10+
use Magento\Customer\Model\GroupManagement;
11+
use Magento\Customer\Model\Vat;
12+
use Magento\Framework\Setup\ModuleDataSetupInterface;
13+
use Magento\Framework\Setup\Patch\DataPatchInterface;
14+
15+
/**
16+
* Update default customer group id in customer configuration if it's value is NULL
17+
*/
18+
class UpdateDefaultCustomerGroupInConfig implements DataPatchInterface
19+
{
20+
/**
21+
* @var ModuleDataSetupInterface
22+
*/
23+
private $moduleDataSetup;
24+
25+
/**
26+
* @var GroupManagement
27+
*/
28+
private $groupManagement;
29+
30+
/**
31+
* @param ModuleDataSetupInterface $moduleDataSetup
32+
* @param GroupManagement $groupManagement
33+
*/
34+
public function __construct(
35+
ModuleDataSetupInterface $moduleDataSetup,
36+
GroupManagement $groupManagement
37+
) {
38+
$this->moduleDataSetup = $moduleDataSetup;
39+
$this->groupManagement = $groupManagement;
40+
}
41+
42+
/**
43+
* @inheritDoc
44+
*/
45+
public function apply()
46+
{
47+
$customerGroups = $this->groupManagement->getLoggedInGroups();
48+
$commonGroup = array_shift($customerGroups);
49+
50+
$this->moduleDataSetup->getConnection()->update(
51+
$this->moduleDataSetup->getTable('core_config_data'),
52+
['value' => $commonGroup->getId()],
53+
[
54+
'value is ?' => new \Zend_Db_Expr('NULL'),
55+
'path = ?' => GroupManagement::XML_PATH_DEFAULT_ID,
56+
]
57+
);
58+
59+
return $this;
60+
}
61+
62+
/**
63+
* @inheritDoc
64+
*/
65+
public function getAliases()
66+
{
67+
return [];
68+
}
69+
70+
/**
71+
* @inheritDoc
72+
*/
73+
public static function getDependencies()
74+
{
75+
return [
76+
DefaultCustomerGroupsAndAttributes::class,
77+
];
78+
}
79+
}

app/code/Magento/Customer/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<field id="default_group" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
4141
<label>Default Group</label>
4242
<source_model>Magento\Customer\Model\Config\Source\Group</source_model>
43+
<validate>required-entry</validate>
4344
</field>
4445
<field id="viv_domestic_group" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
4546
<label>Group for Valid VAT ID - Domestic</label>

app/code/Magento/Indexer/Test/Mftf/ActionGroup/IndexerActionGroup/UpdateIndexerOnSaveActionGroup.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/code/Magento/LoginAsCustomer/Plugin/AdminLogoutPlugin.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,22 @@
88
namespace Magento\LoginAsCustomer\Plugin;
99

1010
use Magento\Backend\Model\Auth;
11+
use Magento\Backend\Model\Auth\Session as AuthSession;
1112
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1213
use Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataForUserInterface;
1314

1415
/**
1516
* Delete all Login as Customer sessions for logging out admin.
17+
*
18+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
1619
*/
1720
class AdminLogoutPlugin
1821
{
22+
/**
23+
* @var AuthSession
24+
*/
25+
private $authSession;
26+
1927
/**
2028
* @var ConfigInterface
2129
*/
@@ -27,13 +35,16 @@ class AdminLogoutPlugin
2735
private $deleteAuthenticationDataForUser;
2836

2937
/**
38+
* @param AuthSession $authSession
3039
* @param ConfigInterface $config
3140
* @param DeleteAuthenticationDataForUserInterface $deleteAuthenticationDataForUser
3241
*/
3342
public function __construct(
43+
AuthSession $authSession,
3444
ConfigInterface $config,
3545
DeleteAuthenticationDataForUserInterface $deleteAuthenticationDataForUser
3646
) {
47+
$this->authSession = $authSession;
3748
$this->config = $config;
3849
$this->deleteAuthenticationDataForUser = $deleteAuthenticationDataForUser;
3950
}
@@ -45,8 +56,10 @@ public function __construct(
4556
*/
4657
public function beforeLogout(Auth $subject): void
4758
{
48-
if ($this->config->isEnabled()) {
49-
$userId = (int)$subject->getUser()->getId();
59+
$user = $subject->getUser();
60+
$isLoggedAsCustomer = $this->authSession->getIsLoggedAsCustomer();
61+
if ($this->config->isEnabled() && $user && $isLoggedAsCustomer) {
62+
$userId = (int)$user->getId();
5063
$this->deleteAuthenticationDataForUser->execute($userId);
5164
}
5265
}

0 commit comments

Comments
 (0)