Skip to content

Commit 49eedef

Browse files
author
Sergii Kovalenko
committed
MAGETWO-69521: Customer attribute with "Show on Storefront" set to No does not appear in backend
1 parent 9ca29a0 commit 49eedef

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,16 @@ private function canShowAttribute(AbstractAttribute $customerAttribute)
384384
return $customerAttribute->getIsVisible();
385385
}
386386

387-
$canShowOnForm = is_array($customerAttribute->getUsedInForms()) &&
388-
(
389-
(in_array('customer_account_create', $customerAttribute->getUsedInForms()) && $isRegistration) ||
390-
(in_array('customer_account_edit', $customerAttribute->getUsedInForms()) && !$isRegistration)
391-
);
387+
if ($customerAttribute->getEntityType()->getEntityTypeCode() === 'customer') {
388+
$canShowOnForm = is_array($customerAttribute->getUsedInForms()) &&
389+
(
390+
(in_array('customer_account_create', $customerAttribute->getUsedInForms()) && $isRegistration) ||
391+
(in_array('customer_account_edit', $customerAttribute->getUsedInForms()) && !$isRegistration)
392+
);
393+
} else {
394+
$canShowOnForm = is_array($customerAttribute->getUsedInForms()) &&
395+
in_array('customer_address_edit', $customerAttribute->getUsedInForms());
396+
}
392397

393398
return ($this->userScope === self::ADMIN_SCOPE && $canShowOnForm) ||
394399
($this->userScope === self::FRONTEND_SCOPE && $canShowOnForm && $customerAttribute->getIsVisible());

0 commit comments

Comments
 (0)