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
A new entity was found through the relationship 'XXX#hcspData' that was not configured to cascade persist operations for entity: HCSPData@0000000023d966fc0000000028e438d7. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @manytoone(..,cascade={"persist"}). If you cannot find out which entity causes the problem implement 'HCSPData#__toString()' to get a clue.
How to reproduce
HCSPData is fetched in service, this service is used in Subscriber pinned with Doctrine prePersist.
It was like that since I remember.
Updating Symfony version resulted in above error. Lowering version to .21 and everything works again.
Doctrine package is the same, so I believe this is not Doctrine problem.
For 3.4.21 $entityManager->contains($documentEntity) // true EntityManager { #540 // where HCSPData is fetched EntityManager { #540 // where XXX is flushed
For 3.4.22 $entityManager->contains($documentEntity) // false EntityManager { #540 // where HCSPData is fetched EntityManager { #559 // where XXX is flushed
What i found - EntityManager fetching HCSPData and EntityManager creating new entity in 3.4.21 is the same object, but in 3.4.22 they are not. You had to made change that is breaking DI object injecting. Both service & subscriber are fetching EM same way: public function __construct(EntityManagerInterface $entityManager)
After some digging I found this:
b3e17d2
Reverting changes from this commit done by @mmarynich makes everything work again.
The text was updated successfully, but these errors were encountered:
Symfony version(s) affected: 3.4.22
Description
How to reproduce
HCSPData is fetched in service, this service is used in Subscriber pinned with Doctrine prePersist.
It was like that since I remember.
Updating Symfony version resulted in above error. Lowering version to .21 and everything works again.
Doctrine package is the same, so I believe this is not Doctrine problem.
For 3.4.21
$entityManager->contains($documentEntity) // true
EntityManager { #540 // where HCSPData is fetched
EntityManager { #540 // where XXX is flushed
For 3.4.22
$entityManager->contains($documentEntity) // false
EntityManager { #540 // where HCSPData is fetched
EntityManager { #559 // where XXX is flushed
What i found -
EntityManager
fetchingHCSPData
andEntityManager
creating new entity in 3.4.21 is the same object, but in 3.4.22 they are not. You had to made change that is breaking DI object injecting. Both service & subscriber are fetching EM same way:public function __construct(EntityManagerInterface $entityManager)
After some digging I found this:
b3e17d2
Reverting changes from this commit done by @mmarynich makes everything work again.
The text was updated successfully, but these errors were encountered: