diff --git a/config/bundles.php b/config/bundles.php index 2b082c4f..1d85d61d 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -23,7 +23,6 @@ return [ Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true, 'test' => true, 'local' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Symplify\ConsoleColorDiff\ConsoleColorDiffBundle::class => ['dev' => true, 'test' => true], - Symplify\ConsoleColorDiff\ConsoleColorDiffBundle::class => ['dev' => true, 'test' => true], Translation\Bundle\TranslationBundle::class => ['all' => true], Translation\PlatformAdapter\Loco\Bridge\Symfony\TranslationAdapterLocoBundle::class => ['dev' => true, 'local' => true], ]; diff --git a/config/services_test.yaml b/config/services_test.yaml index 4e4a00e2..6f84f5cb 100644 --- a/config/services_test.yaml +++ b/config/services_test.yaml @@ -1,3 +1,7 @@ services: - monolog.processor.request: - synthetic: true + _defaults: + autowire: true + autoconfigure: true + + monolog.processor.request: + synthetic: true \ No newline at end of file diff --git a/src/Doctrine/TablePrefix.php b/src/Doctrine/TablePrefix.php index c3cf28b4..41b56c60 100644 --- a/src/Doctrine/TablePrefix.php +++ b/src/Doctrine/TablePrefix.php @@ -19,7 +19,7 @@ class TablePrefix public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void { - if ($tablePrefix = $this->getTablePrefix($eventArgs->getEntityManager())) { + if ($tablePrefix = $this->getTablePrefix()) { $classMetadata = $eventArgs->getClassMetadata(); if (! $classMetadata->isInheritanceTypeSingleTable() diff --git a/src/Doctrine/TablePrefixTrait.php b/src/Doctrine/TablePrefixTrait.php index a566e523..d4966a75 100644 --- a/src/Doctrine/TablePrefixTrait.php +++ b/src/Doctrine/TablePrefixTrait.php @@ -46,10 +46,14 @@ trait TablePrefixTrait return $this; } - protected function getTablePrefix(ObjectManager $manager) + /** + * Since we introduced `symfony/proxy-manager-bridge`, the keys in the tableprefix + * no longer match what the manager tells us it should be. For example, the + * given key was `0000000005ee10ad0000000043b453e3`, but in our reference + * table we had `0000000005ee10e90000000043b453e3`. We just return the first one, now + */ + protected function getTablePrefix(): string { - $key = spl_object_hash($manager); - - return $this->tablePrefixes[$key] ?? ''; + return current($this->tablePrefixes) ?? ''; } } diff --git a/symfony.lock b/symfony.lock index 39118fa1..d06552a5 100644 --- a/symfony.lock +++ b/symfony.lock @@ -894,6 +894,9 @@ "symfony/property-info": { "version": "v4.4.4" }, + "symfony/proxy-manager-bridge": { + "version": "v4.4.10" + }, "symfony/routing": { "version": "4.2", "recipe": {