From 79040b77ef0abf5ddb6dab8995009d9899889e0f Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Sat, 24 Aug 2024 19:56:12 +0200 Subject: [PATCH] Fix create new customer form in admin ui --- Ui/Component/Customer/Form/EraseButton.php | 3 +-- Ui/Component/Customer/Form/ExportButton.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Ui/Component/Customer/Form/EraseButton.php b/Ui/Component/Customer/Form/EraseButton.php index 543394b..b35e268 100644 --- a/Ui/Component/Customer/Form/EraseButton.php +++ b/Ui/Component/Customer/Form/EraseButton.php @@ -39,12 +39,11 @@ public function __construct( public function getButtonData(): array { $customerId = $this->getCustomerId(); - $customer = $this->customerRepository->getById($customerId); $buttonData = []; if ($customerId && $this->authorization->isAllowed('Opengento_Gdpr::customer_erase') - && $this->config->isErasureEnabled($customer->getWebsiteId()) + && $this->config->isErasureEnabled($this->customerRepository->getById($customerId)->getWebsiteId()) && $this->eraseCustomerChecker->canCreate($customerId, 'customer') ) { $buttonData = [ diff --git a/Ui/Component/Customer/Form/ExportButton.php b/Ui/Component/Customer/Form/ExportButton.php index fa67918..af3fc20 100644 --- a/Ui/Component/Customer/Form/ExportButton.php +++ b/Ui/Component/Customer/Form/ExportButton.php @@ -31,12 +31,11 @@ public function __construct( public function getButtonData(): array { $customerId = $this->getCustomerId(); - $customer = $this->customerRepository->getById($customerId); $buttonData = []; if ($customerId && $this->authorization->isAllowed('Opengento_Gdpr::customer_export') - && $this->config->isExportEnabled($customer->getWebsiteId())) { + && $this->config->isExportEnabled($this->customerRepository->getById($customerId)->getWebsiteId())) { $buttonData = [ 'label' => new Phrase('Export Personal Data'), 'class' => 'Export',