Skip to content

Commit

Permalink
Fix issues with Contao 5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmolineus committed Feb 7, 2024
1 parent 0770e97 commit 1848e35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Request/ContaoPageContextInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use function explode;
use function is_array;
use function is_string;
use function method_exists;
use function str_replace;

/**
Expand Down Expand Up @@ -133,6 +134,10 @@ private function initializeLocale(PageContext $context, Request $request): void
*/
private function initializeStaticUrls(): void
{
if (! method_exists(Controller::class, 'setStaticUrls')) {
return;
}

$this->framework->getAdapter(Controller::class)->setStaticUrls();
}

Expand Down Expand Up @@ -161,7 +166,9 @@ private function initializePageLayout(PageContext $context): void
assert($theme instanceof ThemeModel);

// Set the default image densities
$this->pictureFactory->setDefaultDensities($theme->defaultImageDensities);
if ($theme->defaultImageDensities) {
$this->pictureFactory->setDefaultDensities($theme->defaultImageDensities);
}

// Store the layout ID
$page->layoutId = $layout->id;
Expand Down

0 comments on commit 1848e35

Please sign in to comment.