Skip to content

Commit

Permalink
fix error page on multi site
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Feb 17, 2023
1 parent f36aa1f commit 183ff6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/Twig/AppExtension.php
Expand Up @@ -129,7 +129,7 @@ public function getPagePosition(PageInterface $page): int
public function getPublishedPages($host = null, array $where = [], array $orderBy = [], array|int $limit = 0, bool $withRedirection = false): array
{
return Repository::getPageRepository($this->em, $this->getPageClass())
->getPublishedPages($host ?? [], $where, $orderBy, $limit, $withRedirection);
->getPublishedPages($host ?? $this->apps->getMainHost() ?? [], $where, $orderBy, $limit, $withRedirection);
}

/**
Expand All @@ -139,7 +139,7 @@ public function getPublishedPage(string $slug, $host = null): ?PageInterface
{
$pages = Repository::getPageRepository($this->em, $this->getPageClass())
->getPublishedPages(
$host ?? [],
$host ?? $this->apps->getMainHost() ?? [],
[['key' => 'slug', 'operator' => '=', 'value' => $slug]],
[],
1,
Expand Down

0 comments on commit 183ff6d

Please sign in to comment.