Skip to content

Commit bef2142

Browse files
committed
bug symfony#23385 [DoctrineBridge] Fix resetting entity managers with case sensitive id (chalasr)
This PR was merged into the 3.3 branch. Discussion ---------- [DoctrineBridge] Fix resetting entity managers with case sensitive id | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 9737bcc [DoctrineBridge] Use normalizedIds for resetting entity manager services
2 parents 5768424 + 9737bcc commit bef2142

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ protected function resetService($name)
5353
}
5454
$manager->setProxyInitializer(\Closure::bind(
5555
function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
56-
if (isset($this->aliases[$name = strtolower($name)])) {
56+
if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) {
57+
$name = $this->normalizedIds[$normalizedId];
58+
}
59+
if (isset($this->aliases[$name])) {
5760
$name = $this->aliases[$name];
5861
}
5962
$method = !isset($this->methodMap[$name]) ? 'get'.strtr($name, $this->underscoreMap).'Service' : $this->methodMap[$name];

0 commit comments

Comments
 (0)