Questions tagged [symfony]

Symfony refers to both a PHP framework for building web applications as well as a set of components on which the framework is built. This tag refers to the currently supported major versions 2.x, 3.x and 4.x. Alternatively you can specify an exact version using the respective tag. This tag should not be used for questions about Symfony 1.x. Please use the Symfony1 tag instead.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Stylelint output does not show the name of the file where warnings occur

When running stylelint the output of warnings does not show the name of the file where the error occurs (with errors it does work fine). My files look like this: app.scss @import './_file-with-error'...
0
votes
1answer
10 views

Cannot read index “type” from object of type “stdClass” because it doesn't implement \ArrayAccess

I am getting this error on this if ($this->container->getParameter('sso.so') === true) { $builder->add('familyMembers', CollectionType::class, array( 'type' => ...
0
votes
0answers
15 views

Symfony 5 - Can't access dev environment

Not sure what I am doing wrong. Just upgraded a site to symfony 5 from 4.4. All working fine in 4.4 but when I load the sit for 5 I get the error: Fatal error: Uncaught Error: Class 'Symfony\...
0
votes
1answer
15 views

Symfony - FormType - set field display:none by default

in my formType on Symfony I try to hide a default field. So I did like this: ->add('amountReduction', NumberType::class, [ "required" => false, "label" => "...
0
votes
1answer
30 views

Symfony SQL error message : “SQLSTATE[42000]: Syntax error or access violation: 1064”

I have an error that I don't comprehend : An exception occurred while executing 'INSERT INTO achats (year_month, modele, code_reference, date_de_ajout, cout, date_de_achat, importance, ordre, ...
0
votes
0answers
15 views

Create a custom route for a collection using GET method

I do not manage to create a custom route for a collection, my entity is named File. here is my Entity annotation : /** * @ApiResource( * * normalizationContext={"groups"={"file"},"...
0
votes
0answers
15 views

Symfony local server start

I have a very weird error with symfony. If I create a project with the default project creation command and go into the new folder to start the local webserver I get an error: Jan 27 17:51:00 |DEBUG| ...
-1
votes
0answers
6 views

Add custom action (rejected, waiting, accepted) to webform submissions - Drupal 8

We want to add a custom action (rejected, waiting, accepted) to manage submissions of a webform form under drupal 8. how can we do that?
1
vote
1answer
31 views

Api-platform test Client::getResponse() is marked as @internal, what should I use instead?

I have a test case in Api-Platform where I am checking that when I do filtering on a collection it gets me the correct data. Therefore if my response is: { "hydra:member": [ { "...
-3
votes
0answers
26 views

How use a local Database in a “local web server” inside Symfony 5? [closed]

I have installed Symfony 5 and I use the "local web server" feature but the documentation don't provide infos or tips for connect a local database installed on my Mac.
1
vote
1answer
43 views

$this->getUser() not working / Doctrine tries to create a new record instead of updating an existing one

I get the current user with $user = $this->getUser();. In the next lines I change one field of the entity (field = forename). When I persist this $user entity, Doctrine tries an insert. Non-...
0
votes
0answers
24 views

Routing can't find $id from mysql table

Im trying to delete a record in my table from a routing. But it doesnt seem to find the given $id. I have a for loop in my application which loops out records from the table, they all have their own ...
1
vote
1answer
19 views

How i persist data with @ManyToMany Symfony4

I have problem when I want import data (csv) officer with relation ManyToMany Department : the officer (agent in french) are store but the relation are not created (table agent_departement). Agent ...
-1
votes
1answer
32 views

Symfony 4.3 Route Collision in API

* @Route("/vehicle/{id}", methods={"GET"}) * @Route("/vehicle/categories/", methods={"GET"}) When I try to reach my API vehicleCategories without passing any parameters, symfony takes the first ...
-1
votes
0answers
13 views

Adding data to the JWT refresh response

I use LexikJWTAuthenticationBundle and JWTRefreshTokenBundle with Symfony. I try to add custom data on jwt_refresh_token response but i can't. I know we can do it without refresh token using this, but ...
-1
votes
1answer
21 views

Twig for loop can't find record in MySQL database

My for loop doesnt seem to be able to find any records in my database. My loop: {% for school in scholen %} <li>{{ scholen.naam|e }}</li> {% else ...
-1
votes
1answer
27 views

Xdebug on Symfony built-in server

Is it possible to set Xdebug on Symfony built-in server as is used in Apache? I haven`t found any tutorial on the web and I don't know if it's possible, or I have to use Apache to develop in order to ...
-3
votes
0answers
32 views

Symfony keeping objects old and new value(after form submit) [closed]

Is there a way I can keep the old and new entity object values with relations(after form submit) in Symfony and compare them to see the changes only. Thanks! I was thinking for mapped="false" to form ...
0
votes
1answer
14 views

Symfony Mapping Error: “The association Entity\Rule#ruleSettings refers to the owning side field Entity\RuleSettings#rules which does not exist.”

I would ask why am I getting error [FAIL] The entity-class AppBundle\Entity\Rule mapping is invalid: * The association AppBundle\Entity\Rule#ruleSettings refers to the owning side field AppBundle\...
0
votes
0answers
19 views

Is there a way how to implement sub domain routing in Silex

I know Silex is already on its END-OF-LIFE but there are still some companies still using these frameworks/stuff since their application is still working. As of the moment, we are using Silex as our ...
-1
votes
0answers
29 views

Some error show on my laravel project with on server how i can solve this please help me [duplicate]

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) my php php ...
-2
votes
0answers
29 views

Recover or set new password for user on old Symfony Project [closed]

I have a Symfony 2.1.7 project but i forgot the password , i'm looking for a way to recover the password , set a new one or just create a new user , then i can change the roles on the database (i'm ...
0
votes
0answers
24 views

Access control for method login does not work in symfony5?

I just recently started learning symfony. I cant restrict the access of authorized users to the login method in Symfony5. It continues to work despite restrictions)) This my security.yaml: security: ...
0
votes
1answer
34 views

Symfony - Form not redirecting to action specified in form

I'm trying to make a form, which I self-defined the action like this in my controller: $form = $this->createForm(ProgrammeSearchType::class, $search, [ 'action' => $this->generateUrl('...
1
vote
1answer
44 views

Composer warning “Package zendframework/zend-code is abandoned”

I get a warning from composer: Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead. Package zendframework/zend-eventmanager is abandoned, you ...
0
votes
1answer
14 views

Entity (with constraints) + createFormBuilder (with extra fields) fail

My User entity has few properties: private $id; /** Assert\Email */ private $email; /** * @Assert\Length( min=6, minMessage="Password is too short (min 6 symbols)" ) */ private $password; I'm ...
0
votes
0answers
20 views

Apache, how to handle unknown php file like standard URLs?

I am have a Symfony website where I have renamed the main entry point so "index.php" can't accessed nor being indexed by search motors. It works well. But, when I try to access this file I get a 404 ...
0
votes
0answers
11 views

sonata exception when overriding show template for one-to-many association

I have an Invoice that I want to display its rows in a table So I wanted to override the template in the admin class but I get this exception: An exception has been thrown during the rendering of a ...
-2
votes
0answers
43 views

Implementing custom entity manager for Doctrine?

Running Symfony 5.0.3, I have a small entity to manage Users. I have added a 'created' and 'last_updated' field, so I can track when a user was made, and the last time that user was saved (changed ...
0
votes
0answers
16 views

stripe Webhook and Symfony 4

I am trying to install stripe webhook on a symfony 4 project to listen (in Back-end) events, in particular the success of a payment. And execute code after the reception of the event. Here is the code ...
-1
votes
0answers
17 views

How to parallelize php symfony request tasks

I have a symfony4 application with a rest API. For one request incoming to my app, I need to fetch data from differents sources (external WS and database) and return a response. because these tasks ...
-2
votes
0answers
15 views

How to order most recent from blog posts and comments in Symfony with Doctrine with OneToMany?

I am using Doctrine in Symfony 4, and have an Entity for Blog posts linked with OneToMany to Comments. Both Entities have a datetime field. I want to list the blogposts by last updated, meaning the ...
-1
votes
0answers
19 views

How to get the value of symfony bin directory

I'm trying to getiing inside a php class, where I have access to the container, the binary directory whether bin/ or app/. Beacause for example for symfony 2.8 version it was app then for symfony 3.x ...
1
vote
1answer
25 views

Symfony 4 - Doctrine Mapping exception only in Prod environnement

Deploying on a new Symfony 4 project with several entity managers, the following exception occurs ONLY on prod environment. In dev everything is ok. Uncaught PHP Exception Doctrine\Persistence\...
0
votes
1answer
37 views

Doctrine ORDER BY column but DISTINCT on another column

Can't seem to wrap my head round a Doctrine query which I am trying to execute for a monitoring system I am working on. My underlying DB is SQLite. My table is fairly simple: CREATE TABLE ...
0
votes
1answer
48 views

Symfony paths issues

I'm currently working on a basic Symfony project to discover this Framework, my website identifies some French rap albums and gives infos about it, then I created 2 Controllers : "DefaultController" ...
-1
votes
1answer
22 views

Symfony form event POST_SUBMIT

I'm trying to understand how event listeners in symfony forms actually work. I tried different things and I really don't know where I'm wrong... Here's my form : public function buildForm(...
-2
votes
0answers
35 views

Is Laravel with Doctrine a viable solution for Domain Driven Design? [closed]

I would very much appreciate your opinion. I have an existing Laravel project that I have been working for some time. https://github.com/mchekin/rpg At some point, as I became more familiar with DDD,...
0
votes
0answers
34 views

Symfony dynamic database connection

I have following scenario, an application where each user have his own database and a "admin db" used to autenticate users. After sucessfully authenticated, this user entity has a field that gives me ...
1
vote
3answers
36 views

Minimal symfony setup with annonations

i want to create a simple api based on Symfony framework. The controllers are already implemented. 1) What is the minimal setup of composer packages i need? 2) How can i setup a working index.php ...
1
vote
1answer
30 views

Symfony update fails with YAML errors

I have a web application currently running on Symfony 4.3.5 without any problems. I call "php composer.phar update" in my project directory. Composer starts to download and upgrade packages to ...
0
votes
1answer
41 views

Symfony 3.4 Website returns 404 on js and css resources

I have no experience with Symfony and my PHP is very rusty (last time I worked with it was at version 4). I would like to host a copy of this website: https://thronesdb.com/ It has a public git ...
0
votes
0answers
25 views

PHP Word sends back unreadable file

I have a symfony application running on the web - and PHP Word does a good job. The same application is running on my localhost but with a higher symfony version and also a higher php version 7.39. ...
0
votes
0answers
16 views

Defining a locale for twig template translations when using `translation:update`

I'm having a bit of trouble with Symfony twig translations, and I hope someone here can clarify. Say I have a file /templates/general/hello_world.twig , with the contents: {% trans with { '%name%': ...
0
votes
1answer
32 views

How to join two entity methods as one

Based on a private messaging app, my user entity currently have two methods to retrieve messages : One to get the messages sent by the user /** * @ORM\OneToMany(targetEntity="App\Entity\...
0
votes
0answers
17 views

Getting a Simple Symfony 5 App On Amazon AWS As An API Gateway/Lambda For Amazon Cognito

This may involve way too many specific technologies for anyone to be able to answer, but I thought I'd give it a shot. I've ready SO Many tutorials and feel like I'm SO close...there's maybe just one ...
0
votes
1answer
21 views

Doctrine 2, association mapping with conditions

I have a similar problem and DB structure: Doctrine2 association mapping with conditions But, I need collections of Article with approved comments: How to do assotiation mapping, that do without N+...
0
votes
1answer
36 views

Updating laravel 6.0 from 5.8 error with symfony

when I tried to update my laravel proyect from version 5.8 to 6.0 we received an error with simfony Mi composer.json: { "name": "laravel/laravel", "description": "The Laravel Framework.", ...
0
votes
1answer
14 views

How to debug form symfony field values disappearing after handleRequest()?

Question is similar to this: How to debug a Symfony2 form? The problem is - on posting data - the data is in $_POST array. Form has the fields and they even have some values. After handleRequest - ...
1
vote
0answers
27 views

Symfony 4 Search Form by entity type (M:N), results show only fields from form, other missing

I have 2 entities: Worker (id, firstname) and Profession (id, title). I have some workers with one or more professions. When I open website I see worker data with all professions from workers. For ...