File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/code/Magento/Customer/Model Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -318,21 +318,23 @@ public function _construct()
318
318
public function getDataModel ()
319
319
{
320
320
$ customerData = $ this ->getData ();
321
- if (!isset ($ this ->storedAddress [$ customerData ['entity_id ' ]])) {
321
+ if (isset ( $ customerData [ ' entity_id ' ]) && !isset ($ this ->storedAddress [$ customerData ['entity_id ' ]])) {
322
322
$ addressesData = [];
323
323
/** @var \Magento\Customer\Model\Address $address */
324
324
foreach ($ this ->getAddresses () as $ address ) {
325
325
$ addressesData [] = $ address ->getDataModel ();
326
326
}
327
327
$ this ->storedAddress [$ customerData ['entity_id ' ]] = $ addressesData ;
328
+ } elseif (isset ($ customerData ['entity_id ' ], $ this ->storedAddress [$ customerData ['entity_id ' ]])) {
329
+ $ customerData = $ this ->storedAddress [$ customerData ['entity_id ' ]];
328
330
}
329
331
$ customerDataObject = $ this ->customerDataFactory ->create ();
330
332
$ this ->dataObjectHelper ->populateWithArray (
331
333
$ customerDataObject ,
332
334
$ customerData ,
333
335
\Magento \Customer \Api \Data \CustomerInterface::class
334
336
);
335
- $ customerDataObject ->setAddresses ($ this -> storedAddress [ $ customerData[ ' entity_id ' ]] )
337
+ $ customerDataObject ->setAddresses ($ customerData )
336
338
->setId ($ this ->getId ());
337
339
return $ customerDataObject ;
338
340
}
You can’t perform that action at this time.
0 commit comments