Skip to content

Commit 08f0056

Browse files
author
Oleksii Korshenko
authored
Merge pull request #1620 from magento-engcom/2.2-develop-prs
Public Pull Requests #11676 #7915: customer objects are equal to eachother after observing event customer_save_after_data_object by @RomaKis #11677 [BACKPORT 2.2] [TASK] Moved Customer Groups Menu Item from Other sett… by @lewisvoncken Fixed Public Issues #7915 customer objects are equal to eachother after observing event customer_save_after_data_object
2 parents b78dacf + 70425b3 commit 08f0056

File tree

9 files changed

+14
-10
lines changed

9 files changed

+14
-10
lines changed

app/code/Magento/Customer/Model/ResourceModel/CustomerRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public function save(\Magento\Customer\Api\Data\CustomerInterface $customer, $pa
246246
$savedCustomer = $this->get($customer->getEmail(), $customer->getWebsiteId());
247247
$this->eventManager->dispatch(
248248
'customer_save_after_data_object',
249-
['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $customer]
249+
['customer_data_object' => $savedCustomer, 'orig_customer_data_object' => $prevCustomerData]
250250
);
251251
return $savedCustomer;
252252
}

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/CustomerRepositoryTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ public function testSave()
241241
'save',
242242
]);
243243

244+
$origCustomer = $this->customer;
245+
244246
$this->customer->expects($this->atLeastOnce())
245247
->method('__toArray')
246248
->willReturn(['default_billing', 'default_shipping']);
@@ -417,7 +419,7 @@ public function testSave()
417419
->method('dispatch')
418420
->with(
419421
'customer_save_after_data_object',
420-
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
422+
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
421423
);
422424

423425
$this->model->save($this->customer);
@@ -475,6 +477,8 @@ public function testSaveWithPasswordHash()
475477
]
476478
);
477479

480+
$origCustomer = $this->customer;
481+
478482
$this->customer->expects($this->atLeastOnce())
479483
->method('__toArray')
480484
->willReturn(['default_billing', 'default_shipping']);
@@ -642,7 +646,7 @@ public function testSaveWithPasswordHash()
642646
->method('dispatch')
643647
->with(
644648
'customer_save_after_data_object',
645-
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $customerAttributesMetaData]
649+
['customer_data_object' => $this->customer, 'orig_customer_data_object' => $origCustomer]
646650
);
647651

648652
$this->model->save($this->customer, $passwordHash);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<add id="Magento_Customer::customer" title="Customers" translate="title" module="Magento_Customer" sortOrder="30" resource="Magento_Customer::customer"/>
1111
<add id="Magento_Customer::customer_manage" title="All Customers" translate="title" module="Magento_Customer" sortOrder="10" parent="Magento_Customer::customer" action="customer/index/" resource="Magento_Customer::manage"/>
1212
<add id="Magento_Customer::customer_online" title="Now Online" translate="title" module="Magento_Customer" sortOrder="30" parent="Magento_Customer::customer" action="customer/online/" resource="Magento_Customer::online"/>
13-
<add id="Magento_Customer::customer_group" title="Customer Groups" translate="title" module="Magento_Customer" sortOrder="50" parent="Magento_Backend::other_settings" action="customer/group" resource="Magento_Customer::group"/>
13+
<add id="Magento_Customer::customer_group" title="Customer Groups" translate="title" module="Magento_Customer" sortOrder="50" parent="Magento_Customer::customer" action="customer/group" resource="Magento_Customer::group"/>
1414
</menu>
1515
</config>

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* Test Flow:
1818
* 1.Log in to backend as admin user.
19-
* 2.Navigate to Stores>Other Settings>Customer Groups.
19+
* 2.Navigate to Customers > Customer Groups.
2020
* 3.Start to create new Customer Group.
2121
* 4.Fill in all data according to data set.
2222
* 5.Click "Save Customer Group" button.

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteCustomerGroupEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* 2. Customer is created and assigned to this group.
1919
* Steps:
2020
* 1. Log in to backend as admin user.
21-
* 2. Navigate to Stores > Other Settings > Customer Groups.
21+
* 2. Navigate to Customers > Customer Groups.
2222
* 3. Click on Customer Group from grid.
2323
* 4. Click on Delete "Customer Group".
2424
* 5. Confirm in pop-up.

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/DeleteSystemCustomerGroupTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Steps:
1515
* 1. Login to backend as admin user.
16-
* 2. Navigate to Stores > Other Settings > Customer Groups.
16+
* 2. Navigate to Customers > Customer Groups.
1717
* 3. Select system Customer Group specified in data set from grid.
1818
* 4. Perform all assertions.
1919
*

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
1919
</variation>
2020
<variation name="NavigateMenuTest24">
21-
<data name="menuItem" xsi:type="string">Stores > Customer Groups</data>
21+
<data name="menuItem" xsi:type="string">Customers > Customer Groups</data>
2222
<data name="pageTitle" xsi:type="string">Customer Groups</data>
2323
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
2424
</variation>

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerGroupEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* 1. Customer Group is created
2020
* Steps:
2121
* 1. Log in to backend as admin user
22-
* 2. Navigate to Stores > Other Settings > Customer Groups
22+
* 2. Navigate to Customers > Customer Groups
2323
* 3. Click on Customer Group from grid
2424
* 4. Update data according to data set
2525
* 5. Click "Save Customer Group" button

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/VerifyDisabledCustomerGroupFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Steps:
1515
* 1. Login to backend as admin user.
16-
* 2. Navigate to Stores > Other Settings > Customer Groups.
16+
* 2. Navigate to Customers > Customer Groups.
1717
* 3. Select system Customer Group specified in data set from grid.
1818
* 4. Perform all assertions.
1919
*

0 commit comments

Comments
 (0)