Skip to content

Commit

Permalink
fix session_store_active functionality
Browse files Browse the repository at this point in the history
At the moment and since 1.7.19, the `system.languages.session_store_active`
setting has no effect.

Session must be initialized before URI for `$language->setActiveFromUri($uri)`
(called from `$this->initializeUri($config) -> $uri->init()`) to
properly retrieve / store `active_language` in Session.

This was previously detected in #3269 as per the code comment, but got
reversed in 2e9fe80.
  • Loading branch information
nbusseneau authored and mahagr committed Oct 20, 2021
1 parent 33a5709 commit 08d7ad8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/src/Grav/Common/Processors/InitializeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
// TODO: remove in 2.0.
$this->container['accounts'];

// Initialize session (used by URI, see issue #3269).
$this->initializeSession($config);

// Initialize URI (uses session, see issue #3269).
$this->initializeUri($config);

// Initialize session.
$this->initializeSession($config);

// Grav may return redirect response right away.
$redirectCode = (int)$config->get('system.pages.redirect_trailing_slash', 1);
if ($redirectCode) {
Expand Down

0 comments on commit 08d7ad8

Please sign in to comment.