Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #19720 [DoctrineBridge] Enhance exception message in EntityUser…
…Provider (chalasr) This PR was merged into the 2.7 branch. Discussion ---------- [DoctrineBridge] Enhance exception message in EntityUserProvider | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Lots of people use the `UserEntityProvider` without having a custom Repository for the user entity configured on the entity provider and in this case, if the `property` key of the provider isn't set, the exception thrown says: > The Doctrine repository "Doctrine\ORM\EntityRepository" must implement Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface "Doctrine\ORM\EntityRepository" doesn't feel relevant. Plus, we can't guess that the exception is thrown first because there is no `property` configured on the corresponding provider, that is useful to have in the trace IMHO. If accepted, `"Symfony\Component\Security\Core\User\UserProviderInterface"` will need to be replaced by `"Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface"` when merging in newer branches. Commits ------- acc0460 [DoctrineBridge] Enhance exception message in EntityUserProvider
- Loading branch information