Skip to content

Commit 79040b7

Browse files
committed
Fix create new customer form in admin ui
1 parent 3597dc2 commit 79040b7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Ui/Component/Customer/Form/EraseButton.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ public function __construct(
3939
public function getButtonData(): array
4040
{
4141
$customerId = $this->getCustomerId();
42-
$customer = $this->customerRepository->getById($customerId);
4342
$buttonData = [];
4443

4544
if ($customerId
4645
&& $this->authorization->isAllowed('Opengento_Gdpr::customer_erase')
47-
&& $this->config->isErasureEnabled($customer->getWebsiteId())
46+
&& $this->config->isErasureEnabled($this->customerRepository->getById($customerId)->getWebsiteId())
4847
&& $this->eraseCustomerChecker->canCreate($customerId, 'customer')
4948
) {
5049
$buttonData = [

Ui/Component/Customer/Form/ExportButton.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@ public function __construct(
3131
public function getButtonData(): array
3232
{
3333
$customerId = $this->getCustomerId();
34-
$customer = $this->customerRepository->getById($customerId);
3534
$buttonData = [];
3635

3736
if ($customerId
3837
&& $this->authorization->isAllowed('Opengento_Gdpr::customer_export')
39-
&& $this->config->isExportEnabled($customer->getWebsiteId())) {
38+
&& $this->config->isExportEnabled($this->customerRepository->getById($customerId)->getWebsiteId())) {
4039
$buttonData = [
4140
'label' => new Phrase('Export Personal Data'),
4241
'class' => 'Export',

0 commit comments

Comments
 (0)