Skip to content

Commit

Permalink
Merge pull request #108 from dachcom-digital/fix_missing_site_attribute
Browse files Browse the repository at this point in the history
Fix missing site attribute
  • Loading branch information
pascalmoser authored Oct 25, 2022
2 parents 7b70f8b + 6d34559 commit 47c969d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Upgrade Notes

## 4.0.6
- [BUGFIX] Fix missing site attribute in error page [#107](https://github.com/dachcom-digital/pimcore-i18n/issues/107)
## 4.0.5
- [BUGFIX] Wrong Error Page in Static Route Context [@Zodiarc](https://github.com/dachcom-digital/pimcore-i18n/issues/96)
- [BUGFIX] Properly overriding Pimcore ResponseExceptionListener and multisite error page [@Zodiarc](https://github.com/dachcom-digital/pimcore-i18n/pull/101)

## 4.0.4
- [IMPROVEMENT] Check against `isFrontendRequestByAdmin` in route item builder
## 4.0.3
Expand Down Expand Up @@ -98,4 +99,4 @@ i18n:

***

I18nBundle 3.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-i18n/blob/3.x/UPGRADE.md
I18nBundle 3.x Upgrade Notes: https://github.com/dachcom-digital/pimcore-i18n/blob/3.x/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,14 @@ protected function handleErrorPage(ExceptionEvent $event): void
$this->enablePimcoreContext();

try {
$response = $this->documentRenderer->render($document, [
'exception' => $exception,
$attributes = [
'exception' => $exception,
PimcoreContextListener::ATTRIBUTE_PIMCORE_CONTEXT_FORCE_RESOLVING => true,
]);
];
if ($request->attributes->has(SiteResolver::ATTRIBUTE_SITE)) {
$attributes[SiteResolver::ATTRIBUTE_SITE] = $request->attributes->get(SiteResolver::ATTRIBUTE_SITE);
}
$response = $this->documentRenderer->render($document, $attributes);
} catch (\Exception $e) {
// we are even not able to render the error page, so we send the client a unicorn
$response = 'Page not found. 🦄';
Expand Down

0 comments on commit 47c969d

Please sign in to comment.