I have just started a new Symfony 5 project (only worked on Symfony 3 before) and I am having a hard time to understand how values in .env and .env.local work together. The Symfony docs say, that values in .env.local will override values from .env: If you need to override an environment value (e.g. to a diffe…
Tag: symfony
Symfony 5.2.11: Problem with creating Custom Access Decision Manager
I am trying to create a Custom Access Decision Manager by implementing AccessDecisionManagerInterface on Symfony 5.2. Symfony recognizes the decision manager and instantiate it, but it doesn’t pass Voters array to decision manager. So it can’t collect votes, however the default decision manager wo…
Doctrine insists on trying to use PostgreSQLDriver despite contrary config
I am setting up a Symfony 5.2 app, using doctrine/doctrine-bundle 2.4 and doctrine/orm 2.9. My doctrine.yaml config file looks like this: The problem is that when I run doctrine:fixtures:load, I get the following output: It looks like Doctrine is trying to use the Postgre driver, though I have specified MySQL…
shopware6 – inject data in profile page or route http://domain/account/*
In Shopware6, I want to write a controller for the route http://domain/account/*. Only I have to write in eventListener or is there other possibility? I also could not find events for this url (http://domain/account/address). This is my current way, but this is not enough. File : {moduleOneSubscriber.php} Ans…
Symfony 5 / Doctrine: Sorting entity collection by creation DateTime
I am developing a project using Symfony 5. One of my use-cases involves reading a collection from the Database, with the items sorted by creation order, descending (newest first). I am using the “Timestampable” extension from “stof/doctrine-extensions-bundle” to save the createdAt and …
How to set option for validation constraint in Symfony globally?
I need to change format for DateTime validation constraint but I want to do it globally for the whole application to not copy-paste it like this: (I use yaml config in my application) Is there any option to do it globally in Symfony 5 application, using DI parameters or some other way? I didn’t find any…
Symfony autowire/autoconfigure not working
I created a symfony 5.3 api. My plan is to inject the “EntityManager” via “EntityManagerInterface”. Error that comes: My services.yaml My CreateUserAccountController.php in src/Controller/: My composer.json: I know that I dont use the Manager, but it doesn´t work for me. The webserver …
Symfony cascade persist or merge duplication
I have a problem with the cascade persist or merge, I have an application with two entities task and table (task_implements) When I create a task I choose cultures that are linked: If the user chooses 3 cultures => 3 tasks are created If the user chooses 3 cultures then 2 vehicles => 3 tasks must be cre…
Custom Twig filter from bundle: Unable to load the runtime
I’ve a small twig custom filter in my project created following https://symfony.com/doc/current/templating/twig_extension.html . As long as it sits in src/Twig, it works as expected. Now I’m trying to move it to a custom bundle (vendor/turbolabit/tli-base-bundle/src/Twig/) to make it reusable. I m…
Easy Admin 3 Sort by date returns: create_date has no field or association named create_date
I’m trying to sort a field either by asc or desc date. When i add the date field to my backend like so It works and it shows, but when i try to sort it i get the following error Does anyone know why or how this happens ? Thank you EDIT: here is the field in MyEntity Answer You