@@ -108,8 +108,11 @@ class Session extends \Magento\Framework\Session\SessionManager
108
108
private $ accountConfirmation ;
109
109
110
110
/**
111
- * Session constructor.
112
- *
111
+ * @var CustomerRegistry
112
+ */
113
+ private $ customerRegistry ;
114
+
115
+ /**
113
116
* @param \Magento\Framework\App\Request\Http $request
114
117
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver
115
118
* @param \Magento\Framework\Session\Config\ConfigInterface $sessionConfig
@@ -132,6 +135,7 @@ class Session extends \Magento\Framework\Session\SessionManager
132
135
* @param GroupManagementInterface $groupManagement
133
136
* @param \Magento\Framework\App\Response\Http $response
134
137
* @param AccountConfirmation $accountConfirmation
138
+ * @param CustomerRegistry|null $customerRegistry
135
139
* @throws \Magento\Framework\Exception\SessionException
136
140
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
137
141
*/
@@ -157,7 +161,8 @@ public function __construct(
157
161
CustomerRepositoryInterface $ customerRepository ,
158
162
GroupManagementInterface $ groupManagement ,
159
163
\Magento \Framework \App \Response \Http $ response ,
160
- ?AccountConfirmation $ accountConfirmation = null
164
+ ?AccountConfirmation $ accountConfirmation = null ,
165
+ ?CustomerRegistry $ customerRegistry = null ,
161
166
) {
162
167
$ this ->_coreUrl = $ coreUrl ;
163
168
$ this ->_customerUrl = $ customerUrl ;
@@ -173,6 +178,9 @@ public function __construct(
173
178
$ this ->response = $ response ;
174
179
$ this ->accountConfirmation = $ accountConfirmation ?: ObjectManager::getInstance ()
175
180
->get (AccountConfirmation::class);
181
+ $ this ->customerRegistry = $ customerRegistry ?: ObjectManager::getInstance ()
182
+ ->get (CustomerRegistry::class);
183
+
176
184
parent ::__construct (
177
185
$ request ,
178
186
$ sidResolver ,
@@ -429,7 +437,7 @@ public function checkCustomerId($customerId)
429
437
}
430
438
431
439
try {
432
- $ this ->customerRepository -> getById ($ customerId );
440
+ $ this ->customerRegistry -> retrieve ($ customerId );
433
441
$ this ->_isCustomerIdChecked = $ customerId ;
434
442
return true ;
435
443
} catch (\Exception $ e ) {
0 commit comments