mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Use current request instead of main request.
This commit is contained in:
parent
beeadef853
commit
383fd797a3
1 changed files with 2 additions and 2 deletions
|
@ -49,9 +49,9 @@ class UserCacheKeyGenerator
|
||||||
*/
|
*/
|
||||||
public function generateKey(?User $user = null): string
|
public function generateKey(?User $user = null): string
|
||||||
{
|
{
|
||||||
$main_request = $this->requestStack->getMainRequest();
|
$request = $this->requestStack->getCurrentRequest();
|
||||||
//Retrieve the locale from the request, if possible, otherwise use the default locale
|
//Retrieve the locale from the request, if possible, otherwise use the default locale
|
||||||
$locale = $main_request ? $main_request->getLocale() : Locale::getDefault();
|
$locale = $request ? $request->getLocale() : Locale::getDefault();
|
||||||
|
|
||||||
//If no user was specified, use the currently used one.
|
//If no user was specified, use the currently used one.
|
||||||
if (null === $user) {
|
if (null === $user) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue