Skip to content

Commit 3073325

Browse files
authored
Fix customer group extension attributes (#53)
This plugin always created a new extension object, regardless of if one already exists. So it overwrote other extension attributes. This change checks if an extension object already exists first.
1 parent 86cca87 commit 3073325

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/Customer/Model/Plugin/GetListCustomerGroupExcludedWebsite.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ public function afterGetList(
6464
$customerGroupId = (int)$customerGroup->getId();
6565
if (array_key_exists($customerGroupId, $allExcludedWebsites)) {
6666
$excludedWebsites = $allExcludedWebsites[$customerGroupId];
67-
$customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create();
67+
$customerGroupExtensionAttributes = $customerGroup->getExtensionAttributes();
68+
if ($customerGroupExtensionAttributes === null) {
69+
$customerGroupExtensionAttributes = $this->groupExtensionInterfaceFactory->create();
70+
}
6871
$customerGroupExtensionAttributes->setExcludeWebsiteIds($excludedWebsites);
6972
$customerGroup->setExtensionAttributes($customerGroupExtensionAttributes);
7073
}

0 commit comments

Comments
 (0)