Questions tagged [symfony5]

Use this tag for questions addressing particular features of the PHP framework Symfony in version 5. 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 5 was released in November 2019 and includes several changes compared to its predecessor. However there are no new features compared to version 4.4.

1079 questions
3
votes
1 answer

Is there a way to represent a JSON field in EasyAdmin 3?

I'm new to Symfony and still learning. I'm working currently on a Symfony application where I have a table that represents projects and every project have id, title, startDate, endDate and fields where fields is a JSON field that contains data…
3
votes
2 answers

How to resolve Symfony 5 Controller method error - Cannot autowire argument

What could be the reason for this error in Symfony 5 Cannot autowire argument $post of "App\Controller\PostController::show()": it references class "App\Entity\Post" but no such service exists. I have this in twig: {{ path('post.show',…
Emeka Mbah
  • 16,745
  • 10
  • 77
  • 96
3
votes
1 answer

How to display an image in the admin console with EasyAdmin 3.0 and VichUploader?

I've got an entity with an image and I'm using EasyAdmin 3.0 and VichUploader 1.14 to upload the image in the admin console. My problem is that I can't get the image displayed in the admin console. How can I do that ? Here's my entity : class…
3
votes
1 answer

Add PersistentCollection to an object in fixture

I'm trying to create a new fixture for creating a user. This is the fixture : class UserFixtures extends Fixture implements DependentFixtureInterface { private ManagerRegistry $_managerRegistry; public function __construct(ManagerRegistry…
vincent PHILIPPE
  • 975
  • 11
  • 26
3
votes
1 answer

Let a service called by a Symfony command write an update to the terminal

What would be a proper way to have a Service (that will be used by a Command) write information to the terminal? I like the same functionality to parse thousands of records to be able to be called from both a Controller and a Command. When it's…
3
votes
1 answer

Form with file input is not working on GAE

Hey I'm trying to upload a file from an input file in a multipart/form-data form. I'm using Symfony 5.1. Code works great in my local server but it returns a 500 error when submitting the form in Google App Engine prod environment. Here's my…
3
votes
1 answer

symfony don't find post data after fetch

I am trying to send post data using fetch in twig. But I can not access to those variables in the controller. here my fetch let response = await fetch(baseUrl + '/aaa/nom-de-levenement/add', { method: 'POST', headers: { …
victorfau
  • 45
  • 1
  • 4
  • 18
3
votes
1 answer

How to set the AssociationField choice label when using autocomplete() with EasyAdmin 3.x

Is it possible to use a property of the associated Entity as the choice label, rather than the associated Entity ID when using the autocomplete method on an AssociationField in an EasyAdmin EntityCrudController? Example: I have 3 Entities with the…
BrandynL
  • 33
  • 1
  • 4
3
votes
4 answers

Doctrine:migrations:migrate. The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue

When I try to migrate doctrine:migrations:migrate, I get this exception: "The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.". This only occurs when trying to do a migration on the production…
3
votes
1 answer

Uncaught Error: Class 'App\Kernel' not found

I'm currently facing an important issue when i want to run any "php bin/console" command: Symfony\Component\ErrorHandler\Error\ClassNotFoundError^ {#29 #message: """ Attempted to load class "Kernel" from namespace "App".\n Did you forget a…
LenaHic
  • 91
  • 1
  • 5
3
votes
0 answers

Redirection for Symfony 5 project through .htaccess is not working

I tried to install .htaccess file directly from recipes as documentations says on their website(https://symfony.com/doc/current/setup/web_server_configuration.html#using-mod-php-php-cgi-with-apache-2-4), but it didn't install anything. So I went on…
Guzmicz
  • 31
  • 1
  • 3
3
votes
1 answer

How to avoid handling messages from "child" classes in Symfony Messenger?

I guess I'm missing something in the documentation, but the question is pretty simple. Let's say I have a message of class MessageOne and MessageTwo which extends MessageOne. I also have MessageOneHandler which should handle…
Gino Pane
  • 4,740
  • 5
  • 31
  • 46
3
votes
2 answers

How to make relation to MappedSuperclass works?

I have problem with relation Many to One to MappedSuperclass in Symfony 5. I have entities Employee, Employer which extends MappedSuperclass abstract class Person. And I want create raports entity which will be in relation with Person (both Employee…
kris016
  • 147
  • 2
  • 10
3
votes
1 answer

Symfony 5 & FOSCKEDITOR : create a simple custom plugin, icon of this plugin does not appears in the Ckeditor toolbar

From a Symfony 5 website, I installed the useful bundle fosckeditor (CKEDITOR version 4). All works fine, I get the CKEDITOR field on my page. Now I want to create a new simple plugin. I scrupulously followed this official guide and created a new…
spacecodeur
  • 2,206
  • 7
  • 35
  • 71
3
votes
0 answers

Symfony can't find environment variable in the secrets

I have the same problem as asked here. Followed Symfony Secrets Docu exactly as described. Generated the keys. Created the secret variable - php bin/console secrets:set APPLICATION_SECRET_KEY The variable is there with the right value - php…
Jarek
  • 59
  • 6