From 19a5f4ee2cede72c97a3a42958fbcabe4a07894d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Bj=C3=B8rnskov?= Date: Thu, 29 Dec 2011 12:08:23 +0100 Subject: [PATCH] [DoctrineBundle] getIdentifierValues returns an array so we need to use a find method that can handle an aray --- .../Bridge/Doctrine/Security/User/EntityUserProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index f9b262524f6cb..579d6259e8589 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -81,7 +81,7 @@ public function refreshUser(UserInterface $user) // might have changed without proper persistence in the database. // That's the case when the user has been changed by a form with // validation errors. - if (!$id = $this->metadata->getIdentifierValues($user)) { + if (!$ids = $this->metadata->getIdentifierValues($user)) { throw new \InvalidArgumentException("You cannot refresh a user ". "from the EntityUserProvider that does not contain an identifier. ". "The user object has to be serialized with its own identifier " . @@ -89,8 +89,8 @@ public function refreshUser(UserInterface $user) ); } - if (null === $refreshedUser = $this->repository->find($id)) { - throw new UsernameNotFoundException(sprintf('User with id %s not found', json_encode($id))); + if (null === $refreshedUser = $this->repository->findOneBy($ids)) { + throw new UsernameNotFoundException(sprintf('User with id %s not found', json_encode($ids))); } return $refreshedUser;