Skip to content

Commit

Permalink
fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Nov 14, 2023
1 parent ef6041f commit 5161093
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/admin/src/AdminTrait.php
Expand Up @@ -46,7 +46,7 @@ trait AdminTrait

protected TokenStorageInterface $securityTokenStorage;

protected string $formFieldKey = '';
protected string $formFieldKey = 'admin_page_form_fields';

/**
* @var string
Expand Down
20 changes: 16 additions & 4 deletions packages/admin/src/Menu/PageMenuProvider.php
Expand Up @@ -58,9 +58,15 @@ public function getMenu(): ItemInterface
'route' => 'admin_page_list',
'routeParameters' => ['filter[host][value][]' => $host],
]);
if ($this->isRequestingPageEdit($host) && ! $isRequesteingRedirection) {
$hostMenu->setCurrent(true);
if (! $this->isRequestingPageEdit($host)) {
continue;
}

if ($isRequesteingRedirection) {
continue;
}

$hostMenu->setCurrent(true);
}
} elseif ($this->isRequestingPageEdit() && ! $isRequesteingRedirection) {
$pageMenu->setCurrent(true);
Expand All @@ -79,9 +85,15 @@ public function getMenu(): ItemInterface
'route' => 'admin_redirection_list',
'routeParameters' => ['filter[host][value][]' => $host],
]);
if ($this->isRequestingPageEdit($host) && $isRequesteingRedirection) {
$hostMenu->setCurrent(true);
if (! $this->isRequestingPageEdit($host)) {
continue;
}

if (! $isRequesteingRedirection) {
continue;
}

$hostMenu->setCurrent(true);
}
} elseif ($this->isRequestingPageEdit() && $isRequesteingRedirection) {
$redirectionMenu->setCurrent(true);
Expand Down
2 changes: 0 additions & 2 deletions packages/admin/src/PageAdmin.php
Expand Up @@ -102,8 +102,6 @@ protected function exists(string $name): bool
protected function configureFormFields(FormMapper $form): void
{
$this->apps->switchCurrentApp($this->getSubject());

$this->formFieldKey = $this->formFieldKey ?: 'admin_page_form_fields';
$fields = $this->getFormFields();
if (! isset($fields[0]) || ! \is_array($fields[0]) || ! isset($fields[1]) || ! \is_array($fields[1])) {
throw new \LogicException();
Expand Down

0 comments on commit 5161093

Please sign in to comment.