sulu / SuluCommunityBundle

Community features like Login, Registration, Password forget/reset for your sulu application.
MIT License
30 stars 39 forks source link

Fix initializing of webspaces with same role name #112

Closed niklasnatter closed 5 years ago

niklasnatter commented 5 years ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

This PR adjusts the InitCommand to call flush on the EntityManager after initializing a webspace.

Why?

Because this way it is possible to configure the same role for multiple Webspaces. Otherwise the created role is not flushed and therefore created again during the initialization of the second Webspace. This leads to a Doctrine\DBAL\Exception\UniqueConstraintViolationException.