Skip to content

Commit

Permalink
Fix create new customer form in admin ui
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Aug 24, 2024
1 parent 3597dc2 commit 79040b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Ui/Component/Customer/Form/EraseButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
3 changes: 1 addition & 2 deletions Ui/Component/Customer/Form/ExportButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 79040b7

Please sign in to comment.