Skip to content

Commit

Permalink
Revert "Use request_stack service to obtain the session"
Browse files Browse the repository at this point in the history
This reverts commit 2cc3099.
  • Loading branch information
aschempp committed Jan 11, 2023
1 parent b344ff7 commit 1ae3d60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EventListener/BackendView/PageViewListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Contao\Controller;
use Contao\Input;
use Contao\PageModel;
use Contao\System;
use Contao\Session;
use Haste\Util\Url;

class PageViewListener extends AbstractViewListener
Expand All @@ -25,7 +25,7 @@ protected function isSupported()
*/
protected function getCurrentPage()
{
$node = System::getContainer()->get('request_stack')->getSession()->getBag('contao_backend')->get('tl_page_node');
$node = Session::getInstance()->get('tl_page_node');

if ($node < 1) {
return null;
Expand Down Expand Up @@ -54,7 +54,7 @@ protected function getAvailableLanguages(PageModel $page)
*/
protected function doSwitchView($id): void
{
System::getContainer()->get('request_stack')->getSession()->getBag('contao_backend')->set('tl_page_node', (int) $id);
Session::getInstance()->set('tl_page_node', (int) $id);

Controller::redirect(Url::removeQueryString(['switchLanguage']));
}
Expand Down

0 comments on commit 1ae3d60

Please sign in to comment.