There is a database of Regions and Cities. The relationship between the regions and cities tables is one-to-many. Below is my code for adding a new city to the database. It gives an error: https://i….
Tag: symfony5
Symfony Exception Subscriber not triggered
I need to format error messages and output it in JSON format. I have the following event subscriber: And following configuration in ./config/services.yaml This event subscriber is working when e.g. controller throws error. But if I have some other error e.g. wrong DI injection then output is still in Html format and as Symfony error page. How to make that
Symfony: Service in other Service not loaded (Too few arguments)
Background I have a OptionHelper-Class that is looking in the database-table, where I store some flexible parameters. This class is working fine in Controllers. Now I want to use this class in a …
Symfony5/Doctrine can’t find my XML mapping file for my entity
I am currently trying to set up from scratch a Symfony 5 project using Doctrine with XML mapping. I created a simple AppBundle with some entities. After trying to generate my migration, I have this error : No mapping file found named ‘User.orm.xml’ for class ‘AppEntityUserUser’. A quick google search tells me it might be a conflict with annotations (which
How to immediately disable access to a user that is soft-deleted or no longer enabled?
In my application, users with the role ROLE_ADMIN are able to manually disable other user accounts, by setting enabled on the user account to false. Using a user checker, the user will not be able …
Symfony 5 book the fast track: Is redis necessary for installing guestbook
I am trying to launch the “guestbook” web app from the “Symfony 5: the fast track” book. I check that all is well installed by taping the following command: symfony book:check-requirements and all is ok. But when I launch the local web server and the guestbook web site with: symfony open:local I got the following error on my web page:
symfony 5 authentification problem with getUser()
I am trying to work with Symfony 5 and the security component and I am blocked on a bug. the bug is on authentification success after redirection, $this->getUser() return null but at the same time, …