mirror of
https://github.com/jbcr/core.git
synced 2026-04-01 05:42:19 +02:00
Merge pull request #1545 from bolt/fix/table-prefix-went-missing-with-symfony/proxy-manager-bridge
After adding `symfony/proxy-manager-bridge`, table prefix went missing
This commit is contained in:
@@ -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],
|
||||
];
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
services:
|
||||
monolog.processor.request:
|
||||
synthetic: true
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
monolog.processor.request:
|
||||
synthetic: true
|
||||
@@ -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()
|
||||
|
||||
@@ -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) ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user