I’m using the latest Symfony 4 bundle with security package installed.
As I use an admin page for my content I need to login of course and so I generated, how I learned it, an user and class entity with an manyToMany
relationship.
This works well for creating a user and logging in and out, but unfortunately not for modifying a user.
I’m always getting an error about the roles as for edit the field is first not a role entity array entry but a simply array and so I can’t save the user. There is no special user bundle or so installed. When I delete the old entry from the database it works as there than exists no old value.
I also tried with $userid->removeRole($roleRepository->findOneByLabel('ROLE_USER'));
at the beginning but than I also get an error that it must be an instance of the role entity.
Does anyone have any idea how I could resolve this? Or has an example code where I could check myself?