Private
Public Access
1
0

fix: usr: the username was not recognized properly #7

This commit is contained in:
2026-04-20 10:50:58 +02:00
parent 175581cdd5
commit cd93a26c2c
2 changed files with 11 additions and 11 deletions

View File

@@ -407,15 +407,9 @@ class PlayedGameRepository extends ServiceEntityRepository
->leftJoin('g.blue', 'bb') ->leftJoin('g.blue', 'bb')
->leftJoin('g.redAnon', 'ra') ->leftJoin('g.redAnon', 'ra')
->leftJoin('g.blueAnon', 'ba') ->leftJoin('g.blueAnon', 'ba')
->where($qb->expr()->andX( ->where($qb->expr()->orX(
$qb->expr()->orX( $qb->expr()->eq('g.red', ':u'),
$qb->expr()->eq('g.red', ':u'), $qb->expr()->eq('g.blue', ':u'),
$qb->expr()->eq('g.blue', ':u'),
),
$qb->expr()->orX(
$qb->expr()->isNotNull('g.redPoints'),
$qb->expr()->isNotNull('g.resign'),
),
)) ))
->setParameter('u', $user) ->setParameter('u', $user)
->orderBy('g.updated', 'DESC') ->orderBy('g.updated', 'DESC')
@@ -457,4 +451,4 @@ class PlayedGameRepository extends ServiceEntityRepository
->getQuery() ->getQuery()
->getResult(); ->getResult();
} }
} }

View File

@@ -26,6 +26,7 @@ use JsonException;
use Liip\ImagineBundle\Imagine\Cache\CacheManager; use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use RuntimeException; use RuntimeException;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Mercure\HubInterface; use Symfony\Component\Mercure\HubInterface;
use Symfony\Component\Mercure\Update; use Symfony\Component\Mercure\Update;
@@ -50,6 +51,7 @@ readonly class TopicManager implements TopicManagerInterface
private PlayedGameRepository $playedGameRepository, private PlayedGameRepository $playedGameRepository,
private UserRepository $userRepository, private UserRepository $userRepository,
private RequestStack $requestStack, private RequestStack $requestStack,
private Security $security,
) { ) {
} }
@@ -640,7 +642,7 @@ readonly class TopicManager implements TopicManagerInterface
{ {
$playedGame = $this->getPlayedGame($gameAssoc); $playedGame = $this->getPlayedGame($gameAssoc);
null !== $this->requestStack->getCurrentRequest()->getUser() null !== $this->security->getUser()
? $this->saveRegisteredUser($userName, $count, $playedGame) ? $this->saveRegisteredUser($userName, $count, $playedGame)
: $this->saveAnonUser($userName, $count, $playedGame); : $this->saveAnonUser($userName, $count, $playedGame);
@@ -664,6 +666,8 @@ readonly class TopicManager implements TopicManagerInterface
? $playedGame->red = $user ? $playedGame->red = $user
: $playedGame->blue = $user; : $playedGame->blue = $user;
} }
$this->em->persist($playedGame);
} catch (Exception $e) { } catch (Exception $e) {
$this->logger->error($e->getMessage()); $this->logger->error($e->getMessage());
} }
@@ -689,6 +693,8 @@ readonly class TopicManager implements TopicManagerInterface
? $playedGame->redAnon = $anon ? $playedGame->redAnon = $anon
: $playedGame->blueAnon = $anon; : $playedGame->blueAnon = $anon;
} }
$this->em->persist($playedGame);
} catch (Exception $e) { } catch (Exception $e) {
$this->logger->error($e->getMessage()); $this->logger->error($e->getMessage());
} }