Questions tagged [symfony6]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 6. Otherwise use only the general [symfony] tag plus the language tag [php].

Symfony is a framework for web and CLI-applications built on top of a catalog of Symfony components. It is free software released under the MIT license. The project's homepage is symfony.com.

Symfony 6 was released in November 2021 and includes several changes compared to its predecessor. However there are no new features compared to version 5.4.

429 questions
2
votes
1 answer

How to retrieve form constraint violations messages with profiler in Symfony 6 unit test

I'm trying to unit tests some potential behaviors on a contact form in Symfony 6, and specifically test the messages returned by the constraints on the form fields. To do so I try to get these messages within the profiler, but I can't find any…
naspy971
  • 1,137
  • 2
  • 13
  • 31
2
votes
1 answer

How can I display months in French ? Symfony 6.0.2

I built a registration form in Symfony. I am asking for date of birth to my user. I'd like to know how I can display months in French (or other languages). At the moment they are displayed in English. I posted code on UserType.php. I am thinking…
Emilie Tossan
  • 127
  • 1
  • 1
  • 16
2
votes
1 answer

Symfony 6 my login form does not connect me no error message

I have a problem with my login form, I can't connect, I have no error message, it just doesn't connect me. To do a test I recreated a blank symfony project (6.1.*). I created the registration and the connection with the following lines: php…
Kawick
  • 31
  • 7
2
votes
2 answers

Image not accessible in email template by absolute URL when using Symfony and Webpack Encore

What I'm trying to achieve I am trying to add an image to an HTML email template I am testing out using Symfony Mailer, with an email controller and a twig file for my HTML template. My environment Symfony 6.0 set up on WSL2 Symfony Mailer Webpack…
Lushawn
  • 522
  • 1
  • 3
  • 17
2
votes
1 answer

Multiple Entity Managers with Test ENV

I am working with multiple Entity Managers and Connections in both DEV and PROD environements without any problem. In TEST environement I tried to add another connection inside doctrine.yaml file like this: But only the database related to default…
Khribi Wessim
  • 287
  • 2
  • 12
2
votes
1 answer

Is there a way to make Symfony controller return nothing?

I use Symfony 6.1 and PHP 8.1. I'm wondering if there is a way to make a Symfony controller return nothing. The why is I'm using Botman and unfortunalty it send itself a response to the client... So I need to make my controller to return…
Loicyeu
  • 115
  • 9
2
votes
2 answers

Symfony PHPUnit : Failed to start session because header have already been sent

Versions : PHP : 8.1 PHPUnit : 9.5.21 Symfony 6.1 When the following test is run by PhpUnit, I get an error about the session not being able to be started. Does anyone have an idea of the problem and how to solve it? The following topics do not…
Loicyeu
  • 115
  • 9
2
votes
0 answers

How to simulate a TransportException in Symfony testing

I am writing tests for a small Symfony 6 project. The project contains a custom class representing a web form request. The class has methods for sending various emails using the Symfony MailerInterface. For example: public function…
thorndeux
  • 307
  • 2
  • 9
2
votes
3 answers

Symfony 6 login doesn't run auth

I'm trying to make a small application in symfony 6 to practice but I can't get the login to work. I have used the commands make:user, make:crud user, make:auth, and I have let the application build the login for me. The thing is that I manage to…
2
votes
2 answers

Symfony 6 - Fail to inject data into a dynamic formtype on POST_SUBMIT

I have a problem with a nested form. I can't get the values I want to pass. Here is a simple example to reproduce my problem, I would like to pre-fill a form about a user according to the selected house in my form. Here are the files, if you want to…
arno
  • 792
  • 14
  • 33
2
votes
0 answers

Symfony 6 - Error while inserting a new Entry with a ManyToMany Relationship

I am currently working on a symfony 6 project where I came across the following problem: I have to entites "Article" and "ColorPalette". The relationship between the both of these is a ManyToMany Relationship. Now I have a form for creating new…
schwaluck
  • 115
  • 9
2
votes
0 answers

Is there a better way to achieve multiple connection to database in Symfony 6?

I'm having some trouble trying to achieve multiple connection to database in some clean way. Keep in mind that this is my first symfony project ever, and i'm only a young developer. In my project, the goal is to be able to select a client, with a…
2
votes
1 answer

Symfony 6 with TailwindCSS 3: Tailwind components css not generated

I've installed TailwindCSS 3 to my Symfony 6 project. It works mostly. Only the TailwindCSS components CSS will not be generated. Here's my config and the results. webpack.config.js: .enablePostCssLoader((options) => { options.postcssOptions =…
Dominique
  • 51
  • 7
2
votes
1 answer

Make private and removed service available in tests

I'm trying to make vatin-bundle compatible with Symfony 6. But the tests fail The "validator" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and…
Brucie Alpha
  • 1,135
  • 2
  • 12
  • 31
1
vote
1 answer

Not able to display dropdown in Symfony Dynamic form

I'm displaying sub categories but getting following error: Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader::getIdValue(): Argument #1 ($object) must be of type ?object, string given, called…
Demi God
  • 87
  • 9
1 2
3
28 29