Skip to content

Commit

Permalink
Merge pull request #53 from Oksydan/symfony-request-fix-in-the-fo
Browse files Browse the repository at this point in the history
Fix: product customization
  • Loading branch information
Oksydan authored Nov 16, 2024
2 parents 2b13b0f + 7cad1cb commit 9e3420a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Core/ListingDisplay/ThemeListDisplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ class ThemeListDisplay
'list',
];

public function setDisplay($display)
protected function getRequest(): Request
{
Request::setFactory(static function ($query, $request, $attributes, $cookies, $files, $server, $content) {
return new Request($query, $request, $attributes, $cookies, [], $server, $content);
});

return Request::createFromGlobals();
}

public function setDisplay($display): Response
{
if (!in_array($display, $this->displayList)) {
$display = \Configuration::get(GeneralConfiguration::THEMECORE_DISPLAY_LIST);
Expand All @@ -35,7 +44,7 @@ public function setDisplay($display)

public function getDisplay()
{
$displayFromCookie = Request::createFromGlobals()->cookies->get($this->cookieName);
$displayFromCookie = $this->getRequest()->cookies->get($this->cookieName);

if ($displayFromCookie) {
return $displayFromCookie;
Expand Down

0 comments on commit 9e3420a

Please sign in to comment.