Deprecation for symfony project
I am getting this message when I run the test(./bin/phpunit) on my symfony application, anyone know what I need to do to upgrade it?1x: The "Psr\SimpleCache\CacheInterface" / "cache.app.simple" service...
View ArticleEasyAdmin 3 : Nested forms
I'm trying to embed forms into forms. In my case : I want to embed Period and Price form into Offer form into Poi form. The architecture :Poi formOffer formPrice formPeriod formRelations:Poi entity has...
View ArticleAPIPlatform : AccessDeniedException from UserCheck seems not catch exception...
I use APIPlatform v2.4.I implemented a JWT auth and everything works fine. But I want to add a check to login : If a user is inactive, I want to block access, so I use UserCheck according to the...
View ArticleSymfony 4, get the root path of the project from a custom class (not a...
In the src/Utils directory, I created a custom class Foo for various things. I'm looking for a way to get the absolute root path of the symfony 4 project From a controller, its easy with : $webPath =...
View ArticleSymfony Doctrine APCu cache not clearing, "apcu_store" returning false
My PHP version is 7.4.3 and APCu extension is also configured and enabled. I'm using Doctrine APCu cache in my Symfony 4 application. Now whenever I try to clear the result or query or metadata cache I...
View ArticleImage upload with sonata admin
See EDIT aboveI think the issue is pretty simple to solve but I can't find any clear answer right now. I hope you might have an idea.I'm trying to upload an image with sonata admin.In my entity I have...
View ArticleAdd a child field for each Product Field - Symfony Forms
I'm trying to build a Order functionality with Symfony 4.4 FormsI have this, so farclass OrderProductForm extends AbstractType{ public function buildForm(FormBuilderInterface $builder, array $options)...
View ArticleHow to remove query string page from the first page with Knp Paginator?
Suppose I have a job list : foobar.com/jobs, the list is paginated using KnpPagintor. If I click on page 1 it loads the same page but with an URL with query string : foobar.com/jobs?page=1How can I...
View ArticleHow to add arrayNodes without names in Symfony TreeBuilder?
I have the following tree builder configuration:private function addDiscountConfiguration(NodeBuilder $builder): void{ $builder ->arrayNode('discount') ->addDefaultsIfNotSet() ->children()...
View ArticleHow can I make a symfony 4 command to be registered only in dev environment...
In my App I have a helper class App\Command\GenerateFixturesCommand that provides a command named my-nice-project:generate-fixtures.This command consumes a service of my own project named...
View ArticleHow to redirect with flash message when 'object not found by the...
So, I've seen a lot of posts regarding this topic, but in my case it works perfectly, the only problem is that I don't know how to instead of getting the error page, just redirect to the admin page...
View ArticleSymfony form event system
I followed one tutorial to make dependent select on symfony 3 . i did the implementation but i found that the performance is a bit slow for rendering the second select.Here is the link for Tuto :...
View ArticleExtending twig functions [closed]
I have this chunk of code:class TwigExtension extends AbstractExtension{ /** * @var TextDictionary */ protected $dictionary; public function __construct(TextDictionary $dictionary) {...
View ArticleSymfony knpuniversity/oauth2-client-bundle Register user with additionnal fields
I would like to register with google in two steps.Click btn -> Google connecta -> if user in db -> login userb -> if !user in db ->display -> form with additionnal fields (int, string...
View ArticleExtending twig functions [closed]
I have this chunk of code:class TwigExtension extends AbstractExtension{ /** * @var TextDictionary */ protected $dictionary; public function __construct(TextDictionary $dictionary) {...
View ArticleCorrectly show mapping association using inheritance
Im working with entities inheritances using doctrine Class Table Inheritance.I have a base entity BaseEntity.Then I have FirstEntity and SecondEntity that extends the BaseEntity.In other hands, I have...
View ArticleHow to access unmapped data in embedded forms? [duplicate]
I've embedded a collection of forms like here: Embedding a collection of forms. Empty resultsIn my controller, I would like to access (get and set) unmapped fields, like view, new, edit, delete.How do...
View ArticleProblem with CollectionType form in Symfony 4
I've problem with Collectiontype in Symfony 4.I try to save some informations in many table on database.My saving cascade is: 1 releve contains 1 carriere contains lots of infoCarriere contains lots of...
View ArticleSymfony Ldap checkPassword
I'm using Symfony 4.4 and I'm doing my own authenticator. Everything works fine, I just can't figure out how to compare the password entered by the user and the one in Ldap. I would like to do this in...
View ArticleHow to write test for this in symfony?
In my Symfony project, I want to do this task :We need to find a way to add a test to verify all the entities added works fine.You’ll need to create a new test...
View Article