Symfony AssertionError: assert($mapping instanceof ManyToManyOwningSideMapping)

70 Views Asked by At

After upgrading from Symfony 6.1 to 7, I have had that error message :

AssertionError: assert($mapping instanceof ManyToManyOwningSideMapping)

We don't have information about what part of the code makes this error pop. But we can see it must come from doctrine which has just been upgraded.

I tried to clear cache even though I already did it after the general upgrade, to see if the error stops showing up, but nothing came through.

1

There are 1 best solutions below

0
Anaïs A. On

I have found the solution!

I knew it was related to something outdated in my code, specifically with the doctrine attributes, but I got a quick answer here

To sum it up, try to comment/delete the JoinColumn or JoinTable attributes related to the many to many relations in your entities, it should work.

Hope it helps!