Skip to content

Commit 7a1f203

Browse files
committed
ACP2E-2791: Not able to Save Customer attribute information in Admin Edit customer section;
1 parent 6db1257 commit 7a1f203

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP
6666
private $subscriptionManager;
6767

6868
/**
69-
* @var AddressRegistry
69+
* @var SetCustomerStore
7070
*/
71-
private $addressRegistry;
71+
private $customerStore;
7272

7373
/**
74-
* @var SetCustomerStore|null
74+
* @var AddressRegistry
7575
*/
76-
private $customerStore;
76+
private $addressRegistry;
7777

7878
/**
7979
* Constructor
@@ -104,8 +104,8 @@ class Save extends \Magento\Customer\Controller\Adminhtml\Index implements HttpP
104104
* @param ForwardFactory $resultForwardFactory
105105
* @param JsonFactory $resultJsonFactory
106106
* @param SubscriptionManagerInterface $subscriptionManager
107+
* @param SetCustomerStore $customerStore
107108
* @param AddressRegistry|null $addressRegistry
108-
* @param SetCustomerStore|null $customerStore
109109
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
110110
*/
111111
public function __construct(
@@ -135,8 +135,8 @@ public function __construct(
135135
ForwardFactory $resultForwardFactory,
136136
JsonFactory $resultJsonFactory,
137137
SubscriptionManagerInterface $subscriptionManager,
138-
AddressRegistry $addressRegistry = null,
139-
?SetCustomerStore $customerStore = null
138+
SetCustomerStore $customerStore,
139+
AddressRegistry $addressRegistry = null
140140
) {
141141
parent::__construct(
142142
$context,
@@ -166,8 +166,8 @@ public function __construct(
166166
$resultJsonFactory
167167
);
168168
$this->subscriptionManager = $subscriptionManager;
169+
$this->customerStore = $customerStore;
169170
$this->addressRegistry = $addressRegistry ?: ObjectManager::getInstance()->get(AddressRegistry::class);
170-
$this->customerStore = $customerStore ?? ObjectManager::getInstance()->get(SetCustomerStore::class);
171171
}
172172

173173
/**

app/code/Magento/Customer/Controller/Adminhtml/Index/Validate.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Magento\Framework\App\Action\HttpGetActionInterface;
1818
use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
1919
use Magento\Customer\Api\Data\CustomerInterface;
20-
use Magento\Framework\App\ObjectManager;
2120
use Magento\Framework\DataObjectFactory as ObjectFactory;
2221
use Magento\Framework\Message\Error;
2322
use Magento\Customer\Controller\Adminhtml\Index as CustomerAction;
@@ -30,7 +29,7 @@
3029
class Validate extends CustomerAction implements HttpPostActionInterface, HttpGetActionInterface
3130
{
3231
/**
33-
* @var SetCustomerStore|null
32+
* @var SetCustomerStore
3433
*/
3534
private $customerStore;
3635

@@ -60,7 +59,7 @@ class Validate extends CustomerAction implements HttpPostActionInterface, HttpGe
6059
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory
6160
* @param \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory
6261
* @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory
63-
* @param SetCustomerStore|null $customerStore
62+
* @param SetCustomerStore $customerStore
6463
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6564
*/
6665
public function __construct(
@@ -89,7 +88,7 @@ public function __construct(
8988
\Magento\Framework\View\Result\PageFactory $resultPageFactory,
9089
\Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory,
9190
\Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory,
92-
?SetCustomerStore $customerStore = null
91+
SetCustomerStore $customerStore
9392
) {
9493
parent::__construct(
9594
$context,
@@ -118,7 +117,7 @@ public function __construct(
118117
$resultForwardFactory,
119118
$resultJsonFactory
120119
);
121-
$this->customerStore = $customerStore ?? ObjectManager::getInstance()->get(SetCustomerStore::class);
120+
$this->customerStore = $customerStore;
122121
}
123122

124123
/**

app/code/Magento/Customer/Model/SetCustomerStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/************************************************************************
33
*
4-
* Copyright 2023 Adobe
4+
* Copyright 2024 Adobe
55
* All Rights Reserved.
66
*
77
* NOTICE: All information contained herein is, and remains

app/code/Magento/Customer/Test/Unit/Model/SetCustomerStoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/************************************************************************
33
*
4-
* Copyright 2023 Adobe
4+
* Copyright 2024 Adobe
55
* All Rights Reserved.
66
*
77
* NOTICE: All information contained herein is, and remains

0 commit comments

Comments
 (0)