Questions tagged [symfony-4.2]

Symfony is a PHP framework developed by SensioLabs. Symfony 4.2 was released in November 2018.

Symfony is a PHP web framework first released in July 2011 and was created by SensioLabs. Symfony 4.2 was released in November 2018.

Bug fixes

  • bug #29343 [Form] Handle all case variants of "nan" when parsing a number (@mwhudson, @xabbuh)
  • bug #29373 [Routing] fix trailing slash redirection (@nicolas-grekas)
  • bug #29355 [PropertyAccess] calculate cache keys for property setters depending on the value (@xabbuh)
  • bug #29369 [DI] fix combinatorial explosion when analyzing the service graph (@nicolas-grekas)
  • bug #29349 [Debug] workaround opcache bug mutating "$this" !?! (@nicolas-grekas)
  • bug #29344 Fixes sprintf(): Too few arguments in Translator (@stephanedelprat)
  • bug #29318 [Console] Move back root exception to stack trace in verbose mode (@chalasr)

Documentation / Resources

  • Overview: Documentation for current version.
  • Flex: New way to manage Symfony apps.
  • Best Practices: Best practices for developing web apps, esp. the ones using the full-stack Symfony framework.
  • Symfony Recipes Server: Includes official and community recipes.
96 questions
12
votes
2 answers

Symfony 4 argument has no type-hint, you should configure its value explicitly

Symfony 4.2.3 Recently upgraded from version 3.4 to 4.2.3 and got my project working, but when setting autoconfigure in services.yaml to true, I will receive this error message: Cannot autowire service…
RoyRobsen
  • 457
  • 1
  • 9
  • 20
6
votes
1 answer

Service "form.factory" not found when calling createForm

I follow a class where there's an example how to make a form. When I try it I get a ServiceNotFoundException error and I can't find it anywhere on the web. Service "form.factory" not found: the container inside "App\Controller\MyTestController"…
4
votes
1 answer

Why are .env files preferred over .yaml files for environment variables?

What is/are the main reason(s), for which Symfony preferres to use .env files - for holding values of environment variables in them - instead of using the more flexible .yaml files? I am asking this, because I read this comment, which states: It…
PajuranCodes
  • 303
  • 3
  • 12
  • 43
4
votes
1 answer

Symfony losing auth session between login and redirect

I have an app that's has a form login which has been working fine. I then added an api side to it using this guide. Now my log in on the web side doesn't work anymore. This is my security.yaml file: security: #…
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69
4
votes
3 answers

Symfony 4 EasyAdmin how to encrypt passwords?

I am using EasyAdmin to add/edit users and wanted to ask if there is a possibility of encrypting your passwords? Password encryption worked previously when I used the Symfony 4 make:registration-form but I can't use that now, I have to use…
D. Gillard
  • 63
  • 1
  • 1
  • 5
3
votes
1 answer

Prevent JMS Serializer to convert CamelCase to UnderscoreCase

i started an API Rest with symfony 4.2 and these bundle (FOSRestBundle, JMS Serializer Bundle). I have an Angular application which send many request with body who has property like firstName, but it doesn't match with my User property while its…
3
votes
2 answers

How to fix migrations running on both databases when setting up multiple databases with symfony4 and doctrine

I am trying to setup a second database for a symfony 4.2 project. Everything seems to working fine up until the point where I run migrations where all migrations execute on the given connection instead of only the migrations for the connection it…
Piels
  • 31
  • 2
3
votes
0 answers

Api-Platform missing "servers" configuration key in api_platform.yaml

On Api Platform configuration page servers key is missing. More info here: https://api-platform.com/docs/core/configuration/ https://swagger.io/docs/specification/api-host-and-base-path/ I need to find a solution to add servers to the…
3
votes
1 answer

How to create fixture where there is relation between two tables in Symfony?

I have two entities say 'User' and 'Address' in which I have 'OneToOne' relation between them. User table has a column 'address_id' which is Foreign key, stores the id of Address table. I have tried to create fixture by using 2 different…
Saurabh
  • 432
  • 1
  • 10
  • 23
3
votes
0 answers

How to handle not found exceptions when using @ParamConverter in Symfony4?

For example, I converter an entity in my update method in a controller, public function show(Post $post): Response According to the spec, If no Post object is found, a 404 Response is generated; Symfony will return a 404 response directly, but…
yifei3212
  • 821
  • 1
  • 9
  • 28
3
votes
1 answer

symfony 4.2 max_depth_handler serializer how to implement?

Hey just an hour ago I asked a question about the new circular_reference_handler in symfony 4.2's serializer. (use the "circular_reference_handler" key of the context instead symfony 4.2) The answer to that question leads me to a new problem of the…
Dennis de Best
  • 1,078
  • 13
  • 30
3
votes
5 answers

Use the "circular_reference_handler" key of the context instead symfony 4.2

I have to serialize an object and I get the ever so common "circular reference error" I have used the old Symfony method : $normalizer = new ObjectNormalizer(); // Add Circular reference handler $normalizer->setCircularReferenceHandler(function…
Dennis de Best
  • 1,078
  • 13
  • 30
2
votes
2 answers

Symfony 4.2 can't Logout

I would like to implement the logout action on my Symfony project. At the moment, when I make the logout action, I receive the exception controller can be blank: it will never be executed!. I've digged into internet and Symfony docs, normally this…
2
votes
1 answer

error: class has no constructor caused by using abstractController symfony4.2?

please can u tell me what how to use AbstractController in symfony4.2 and how to inject services in contruct Controller? nameSpace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use…
Mi Ba
  • 21
  • 3
2
votes
1 answer

how to insert file csv symfony 4

i'm a beginner in symfony 4 :), i want to insert a csv file in my database via an input file in symfony 4 i try something in my controller but he transform the file.csv in file.txt, i don't understand why ? public function upload(Request…
braknight
  • 23
  • 1
  • 3
1
2 3 4 5 6 7