Skip to content

Commit 21abc71

Browse files
committed
Merge branch '2.4-develop' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-3043
2 parents 17be334 + 4bca5df commit 21abc71

File tree

194 files changed

+1529
-1963
lines changed

Some content is hidden

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

194 files changed

+1529
-1963
lines changed

app/code/Magento/Analytics/ReportXml/BatchReportProviderInterface.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
<?php
2-
/************************************************************************
3-
*
2+
/**
43
* Copyright 2023 Adobe
54
* All Rights Reserved.
6-
*
7-
* NOTICE: All information contained herein is, and remains
8-
* the property of Adobe and its suppliers, if any. The intellectual
9-
* and technical concepts contained herein are proprietary to Adobe
10-
* and its suppliers and are protected by all applicable intellectual
11-
* property laws, including trade secret and copyright laws.
12-
* Dissemination of this information or reproduction of this material
13-
* is strictly forbidden unless prior written permission is obtained
14-
* from Adobe.
15-
* ************************************************************************
165
*/
176
declare(strict_types=1);
187

app/code/Magento/Backend/Controller/Adminhtml/System/Account/Save.php

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
namespace Magento\Backend\Controller\Adminhtml\System\Account;
77

@@ -11,9 +11,11 @@
1111
use Magento\Framework\Controller\ResultFactory;
1212
use Magento\Framework\Exception\State\UserLockedException;
1313
use Magento\Security\Model\SecurityCookie;
14+
use Magento\User\Model\User;
1415

1516
/**
1617
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
* @SuppressWarnings(PHPMD.AllPurposeAction)
1719
*/
1820
class Save extends \Magento\Backend\Controller\Adminhtml\System\Account
1921
{
@@ -25,8 +27,11 @@ class Save extends \Magento\Backend\Controller\Adminhtml\System\Account
2527
/**
2628
* Get security cookie
2729
*
30+
* @deprecated 100.1.0 This method is deprecated because dependency injection should be used instead of
31+
* directly accessing the SecurityCookie instance.
32+
* Use dependency injection to get an instance of SecurityCookie.
33+
* @see \Magento\Backend\Controller\Adminhtml\System\Account::__construct()
2834
* @return SecurityCookie
29-
* @deprecated 100.1.0
3035
*/
3136
private function getSecurityCookie()
3237
{
@@ -81,7 +86,29 @@ public function execute()
8186
} else {
8287
$user->save();
8388
$user->sendNotificationEmailsIfRequired();
84-
$this->messageManager->addSuccessMessage(__('You saved the account.'));
89+
90+
$modifiedFields = $this->getModifiedFields($user);
91+
if (!empty($modifiedFields)) {
92+
$countModifiedFields = count($modifiedFields);
93+
// validate how many fields were modified to display them correctly
94+
if ($countModifiedFields > 1) {
95+
$lastModifiedField = array_pop($modifiedFields);
96+
$modifiedFieldsText = implode(', ', $modifiedFields);
97+
$successMessage = __(
98+
'The %1 and %2 of this account have been modified successfully.',
99+
$modifiedFieldsText,
100+
$lastModifiedField
101+
);
102+
} else {
103+
$successMessage = __(
104+
'The %1 of this account has been modified successfully.',
105+
reset($modifiedFields)
106+
);
107+
}
108+
$this->messageManager->addSuccessMessage($successMessage);
109+
} else {
110+
$this->messageManager->addSuccessMessage(__('You saved the account.'));
111+
}
85112
}
86113
} catch (UserLockedException $e) {
87114
$this->_auth->logout();
@@ -103,4 +130,22 @@ public function execute()
103130
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
104131
return $resultRedirect->setPath("*/*/");
105132
}
133+
134+
/**
135+
* Get user modified fields
136+
*
137+
* @param User $user
138+
* @return array
139+
*/
140+
private function getModifiedFields(User $user)
141+
{
142+
$modifiedFields = [];
143+
$propertiesToCheck = ['password', 'username', 'firstname', 'lastname', 'email'];
144+
foreach ($propertiesToCheck as $property) {
145+
if ($user->getOrigData($property) !== $user->{'get' . ucfirst($property)}()) {
146+
$modifiedFields[] = $property;
147+
}
148+
}
149+
return $modifiedFields;
150+
}
106151
}

app/code/Magento/Backend/Test/Unit/Controller/Adminhtml/System/Account/SaveTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2014 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -215,7 +215,8 @@ public function testSaveAction(): void
215215
Form::IDENTITY_VERIFICATION_PASSWORD_FIELD => 'current_password'
216216
];
217217

218-
$testedMessage = 'You saved the account.';
218+
$testedMessage = "The password, username, firstname, lastname and email of this account"
219+
." have been modified successfully.";
219220

220221
$this->authSessionMock->expects($this->any())->method('getUser')->willReturn($this->userMock);
221222

app/code/Magento/Bundle/Model/Product/OriginalPrice.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
<?php
2-
/************************************************************************
3-
*
2+
/**
43
* Copyright 2024 Adobe
54
* All Rights Reserved.
6-
*
7-
* NOTICE: All information contained herein is, and remains
8-
* the property of Adobe and its suppliers, if any. The intellectual
9-
* and technical concepts contained herein are proprietary to Adobe
10-
* and its suppliers and are protected by all applicable intellectual
11-
* property laws, including trade secret and copyright laws.
12-
* Dissemination of this information or reproduction of this material
13-
* is strictly forbidden unless prior written permission is obtained
14-
* from Adobe.
15-
* ************************************************************************
165
*/
176
declare(strict_types=1);
187

app/code/Magento/Bundle/Plugin/Quote/UpdateBundleQuoteItemBaseOriginalPrice.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
<?php
2-
/************************************************************************
3-
*
2+
/**
43
* Copyright 2024 Adobe
54
* All Rights Reserved.
6-
*
7-
* NOTICE: All information contained herein is, and remains
8-
* the property of Adobe and its suppliers, if any. The intellectual
9-
* and technical concepts contained herein are proprietary to Adobe
10-
* and its suppliers and are protected by all applicable intellectual
11-
* property laws, including trade secret and copyright laws.
12-
* Dissemination of this information or reproduction of this material
13-
* is strictly forbidden unless prior written permission is obtained
14-
* from Adobe.
15-
* ************************************************************************
165
*/
176
declare(strict_types=1);
187

app/code/Magento/Bundle/Test/Mftf/ActionGroup/AdminFillCatalogProductsListWidgetSkuActionGroup.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/************************************************************************
4-
*
3+
/**
54
* Copyright 2023 Adobe
65
* All Rights Reserved.
7-
*
8-
* NOTICE: All information contained herein is, and remains
9-
* the property of Adobe and its suppliers, if any. The intellectual
10-
* and technical concepts contained herein are proprietary to Adobe
11-
* and its suppliers and are protected by all applicable intellectual
12-
* property laws, including trade secret and copyright laws.
13-
* Dissemination of this information or reproduction of this material
14-
* is strictly forbidden unless prior written permission is obtained
15-
* from Adobe.
16-
* ***********************************************************************
176
*/
187
-->
198

app/code/Magento/Bundle/Test/Mftf/Test/StorefrontBundleAddToCartFromWidget.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/************************************************************************
4-
*
3+
/**
54
* Copyright 2023 Adobe
65
* All Rights Reserved.
7-
*
8-
* NOTICE: All information contained herein is, and remains
9-
* the property of Adobe and its suppliers, if any. The intellectual
10-
* and technical concepts contained herein are proprietary to Adobe
11-
* and its suppliers and are protected by all applicable intellectual
12-
* property laws, including trade secret and copyright laws.
13-
* Dissemination of this information or reproduction of this material
14-
* is strictly forbidden unless prior written permission is obtained
15-
* from Adobe.
16-
* ***********************************************************************
176
*/
187
-->
198

app/code/Magento/BundleGraphQl/Model/Resolver/BundlePriceDetails.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
<?php
2-
/************************************************************************
3-
*
4-
* Copyright 2024 Adobe
2+
/**
3+
* Copyright 2023 Adobe
54
* All Rights Reserved.
6-
*
7-
* NOTICE: All information contained herein is, and remains
8-
* the property of Adobe and its suppliers, if any. The intellectual
9-
* and technical concepts contained herein are proprietary to Adobe
10-
* and its suppliers and are protected by all applicable intellectual
11-
* property laws, including trade secret and copyright laws.
12-
* Dissemination of this information or reproduction of this material
13-
* is strictly forbidden unless prior written permission is obtained
14-
* from Adobe.
15-
* ************************************************************************
165
*/
176
declare(strict_types=1);
187

app/code/Magento/Catalog/Model/Category/Attribute/Backend/DefaultSortby.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22
/**
33
* Copyright 2024 Adobe
44
* All Rights Reserved.
5-
*
6-
* NOTICE: All information contained herein is, and remains
7-
* the property of Adobe and its suppliers, if any. The intellectual
8-
* and technical concepts contained herein are proprietary to Adobe
9-
* and its suppliers and are protected by all applicable intellectual
10-
* property laws, including trade secret and copyright laws.
11-
* Dissemination of this information or reproduction of this material
12-
* is strictly forbidden unless prior written permission is obtained
13-
* from Adobe.
145
*/
156
declare(strict_types=1);
167

app/code/Magento/Catalog/Model/Category/LayoutCacheTagResolver.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
11
<?php
2-
/************************************************************************
3-
*
2+
/**
43
* Copyright 2024 Adobe
54
* All Rights Reserved.
6-
*
7-
* NOTICE: All information contained herein is, and remains
8-
* the property of Adobe and its suppliers, if any. The intellectual
9-
* and technical concepts contained herein are proprietary to Adobe
10-
* and its suppliers and are protected by all applicable intellectual
11-
* property laws, including trade secret and copyright laws.
12-
* Dissemination of this information or reproduction of this material
13-
* is strictly forbidden unless prior written permission is obtained
14-
* from Adobe.
15-
* ************************************************************************
165
*/
176
declare(strict_types=1);
187

0 commit comments

Comments
 (0)