You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating, I get an error saying that an entity was not found in the chain configured namespaces. This seems to be because I have two entity managers in doctrine.yml that each have separate mappings. These entity managers are also registered as auditing providers. Yet in the code in Provider/Doctrine/Configuration.php all entities are processed for each auditing service, which cannot possibly work.
foreach ($auditingServices as $auditingService) {
$entityManager = $auditingService->getEntityManager();
$platform = $entityManager->getConnection()->getDatabasePlatform();
...
\assert(null !== $this->entities);
foreach ($this->entities as $entity => $config) {
//Below line fails because an entity is not mapped for the current auditingService/entityManager
$meta = $entityManager->getClassMetadata(DoctrineHelper::getRealClassName($entity));
Current behavior
Loading entities crashes and auditing changes therefore does not work
How to reproduce
Have two entity managers setup in doctrine.yml. Each having different entity mappings. Register the entity managers are auditingProviders and try to edit some entities. It will crash on flush because it is trying to load an entity metadata with an entityManager it is not mapped for.
Expected behavior
It should load entities that are mapped to the relevant entityManager, and skip an entityManager if it does not have the correct mapping.
As a workaround I can register every entity to every entityManager, but that is sloppy and bloats the code
The text was updated successfully, but these errors were encountered:
auditor-bundle
versionSummary
After updating, I get an error saying that an entity was not found in the chain configured namespaces. This seems to be because I have two entity managers in doctrine.yml that each have separate mappings. These entity managers are also registered as auditing providers. Yet in the code in
Provider/Doctrine/Configuration.php
all entities are processed for each auditing service, which cannot possibly work.Doctrine.yml:
Current behavior
Loading entities crashes and auditing changes therefore does not work
How to reproduce
Have two entity managers setup in doctrine.yml. Each having different entity mappings. Register the entity managers are auditingProviders and try to edit some entities. It will crash on flush because it is trying to load an entity metadata with an entityManager it is not mapped for.
Expected behavior
It should load entities that are mapped to the relevant entityManager, and skip an entityManager if it does not have the correct mapping.
As a workaround I can register every entity to every entityManager, but that is sloppy and bloats the code
The text was updated successfully, but these errors were encountered: