Skip to content

Commit 05b1755

Browse files
committed
bug #9656 [DoctrineBridge] normalized class names in the ORM type guesser (fabpot)
This PR was merged into the 2.2 branch. Discussion ---------- [DoctrineBridge] normalized class names in the ORM type guesser | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #5837 | License | MIT | Doc PR | n/a Commits ------- a1b9c2e [DoctrineBridge] normalized class names in the ORM type guesser
2 parents 261a459 + a1b9c2e commit 05b1755

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Symfony\Component\Form\Guess\Guess;
2020
use Symfony\Component\Form\Guess\TypeGuess;
2121
use Symfony\Component\Form\Guess\ValueGuess;
22+
use Doctrine\Common\Util\ClassUtils;
2223

2324
class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
2425
{
@@ -161,6 +162,9 @@ public function guessPattern($class, $property)
161162

162163
protected function getMetadata($class)
163164
{
165+
// normalize class name
166+
$class = ClassUtils::getRealClass(ltrim($class, '\\'));
167+
164168
if (array_key_exists($class, $this->cache)) {
165169
return $this->cache[$class];
166170
}

0 commit comments

Comments
 (0)