Questions tagged [symfony4]

Symfony is a PHP framework developed by SensioLabs. Symfony 4 was released in November 2017.

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

Allow only one Login with user credential in Symfony 4

Using Symfony 4, I try to grant access only if there is no user already connected with the same credentials. I'm using the authenticator guards, but no clue how to check if there is an active session ...
-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
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 ...
-1
votes
0answers
8 views

Adding custom doctrine/dbal on symfony 4.3 with symfony/orm-pack ever require

I've make a fork of doctrine/dbal to add firebird database support. I've modify my composer.json by adding : "repositories": [ { "type": "vcs", "url": "[email protected]:...
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\...
-1
votes
0answers
13 views

Sylius BitBag Elasticsearch how to implement Site-wide search on start page

i want to implement in my Sylius project the BitBag Elasticsearch - but Site-Wide. BBES Site-Wide-Search But i don't know how to get the form in my homepage controller. Is there any help for me? My ...
-1
votes
0answers
12 views

How to prefill form values with Symfony 4 form listeners?

I would like to prefill form values from a form event listener. I tried this, but nothing happens: public function buildForm(FormBuilderInterface $builder, array $options) { /* ...*/ $...
0
votes
1answer
23 views

symfony 4.4 : datetime must be a string?

I migrated a project from symfony 3.4 to symfony 4.4 (back side with api platform) In an entity I have a date field, which is automatically generated on today's date, So when I make a POST or a PUT, ...
1
vote
0answers
26 views

Redirecting users after login through remember_me to different routes depending on their ROLES in Symfony 4

I am trying to redirect my users to different routes depending on their ROLES when they login. It works fine within my LoginFormAuthenticator (onAuthenticationSuccess function), but not once the used ...
0
votes
1answer
34 views

Multiple entry points not working in Symfony 4.4

I have 2 user types on a website: Users and Vendors. Each of those types will use own login form. Therefore I've decided to create 2 separate firewalls in security.yaml: security: encoders: ...
0
votes
1answer
25 views

Symfony4 'ERROR : Variable does not exist', when i call a variable in my template

I'm blocked on error with Symfony 4.3. I have installed the bundle : CMENGoogleChartsBundle Installation is ok, no errors. So i wanted try it, i have create a new controller "TestChartController" ...
0
votes
2answers
33 views

Redirect to “/” route in symfony

I'm trying to redirect to the "/" route (same page) after a form submission: /** * @Route("/") */ My approach: return $this->redirectToRoute('/'); Gives me the following error: Unable to ...
-2
votes
0answers
36 views

Symfony 4, Doctrine, rich entities and dependency injection

I'm starting an app using symfony 4 and I'd like to use a rich entity approach. Rich entity means i'll have to do some stuff in the entities and need some external services. Is there a way to inject ...
-1
votes
0answers
19 views

Symfony 5.0.3 Command “server:run” is not defined. ERROR [closed]

I did not understand the reason for this error. Also I update this too "composer require symfony 4.4 bundle" but still I couldn't find a solution to my problem.
0
votes
2answers
23 views

how to open the generated pdf in new tab on symfony 4

on my Symfony 4 app, i have a botton that used to generate pdf from html using knp snappy bundle but the generated pdf get displayed in the same page , so i'm looking for a way to open the generated ...
0
votes
0answers
16 views

bugsnag + symfony - report notices and deprecations

We used Bugsnag to aggregate and report issues on a symfony 4 project. All works well except the fact that notices are logged but not sent into bugsnag. From what I see in code for the bugsnag ...
0
votes
1answer
35 views

Symfony - duplicate entity object setting

I am targeting all entity objects from one table to fill the other with the same data. I want to set results that I have found in CardBalances table to Balances tablefind by the same card_id in ...
1
vote
2answers
74 views

There is no user provider for user, symfony 3.4.37 and 4.4.3

Since the upgrade to Symfony 3.4.37, I'm having this issue There is no user provider for user "Mybundle\Myuser". With version 3.4.36 and previous, it was working fine. security.yml security: ...
0
votes
0answers
37 views

Migrate to docker desktop 2.2 generate acl errors

Description: One of my team member has migrate docker desktop to version 2.2. Since, the php service won't start due to setfacl command from an entrypoint.sh. Context: We are working on a api-...
1
vote
2answers
40 views

Install twig/extensions on a Symfony 4 or Symfony 5 new project

I'm preparing to migrate a huge website from Symfony 3.4 to Symfony 4.4. To do this, I'm starting from a new fresh installation of Symfony 4.4, and as the intial project requires the use of Twig ...
1
vote
0answers
10 views

Integrating Gitlab giving authentication issue in symfony

I am trying to implement Gitlab authentication in my Symfony project. These are the list of my files. GitlabAuthController.php /** * Class GitlabAuthController. * @Route("/api") */ class ...
0
votes
0answers
16 views

Symfony 4 + Sonata Admin - No metadata found for property in inherited property

I've got an error for some time now when I try to add filters to an Admin. There are two entities: Client and Order. In the OrderAdmin file, the following filters work: $datagridMapper ->add('...
-2
votes
1answer
32 views

Problem on Symfony Mailer with SMTP and certificate ssl not valid

Symfony version(s) affected: 4.4.3 Mailer component (not swiftmailer) Description i try to send a mail on the SMTP server but this one don't have a certicate valid. So How to disable the ssl ? How ...
-1
votes
2answers
21 views

Symfony Validator: validate by comparing the old value from the DB

I'm working with Symfony 4.4, For security reason, when submitting OrderProduct entity that embedd Product entity, I have to control some values of OrderProduct taken from Product. So, it's an ...
-1
votes
1answer
31 views

How are Symfony services private by default?

From the official release, Symfony services are private by default. But when I run debug command on my Symfony-4.4 container: bin/console debug:container It still lists a lot of Symfony framework ...
0
votes
1answer
14 views

how to configure knp_snappy bundle to generate a different page format

I'm working on an app using Symfony 4 , i encounter a problem while doing the print function or the generation of the Pdf from html for different format, my app does release bills using a controller ...
-1
votes
0answers
27 views

Problem with Command line symfony version 4.12.4

When I use the symfony new project command, the terminal answers me that it is done and that the project is ready but I have absolutely no files created, it worked before the update ... Do you have a ...
0
votes
0answers
8 views

Need documentation : How to create custom formType from EntityType ? (can't find anything similar in Symfony Documentation)

I 'm trying to create a custom formType From an Entity with 1 checkbox, 2 labels and 1 text field : Something like that : [ ] My label : My label 2 [__________] So, I create a class ...
0
votes
1answer
29 views

MyPOS Checkout usingSymfony

Actually im about to configure myPOS Checkout with my somfony 4 project but their documentation about the configuration not that clear have no idea from where to begin. If anyone can help it would be ...
-1
votes
1answer
27 views

How to update roles in security token in Symfony 4 without re-logging in

I'm trying to update User's roles after the user confirms its phone number. I make the update in the database: $user->setRoles(["ROLE_USER"]); $em->persist($user); That works fine and updates ...
0
votes
1answer
20 views

Symfony4 Twig Extension return image path

I want to create a TwigExtension Function in Symfony4 in order to display images based on a string property in the view. I have installed the assets: "symfony/asset": "^4.4", In lower versions of ...
-4
votes
0answers
42 views

Is there any good example how to use Symfony API Platform? [closed]

We're trying to build API with API Platform, but we found constant problems with finding good example/practices on using the platform. Our constant requirements were/are: Separation of entities and ...
-1
votes
2answers
42 views

Protect Oracle database against SQL Injection

I'm on Symfony and I don't know how protect my database against sql injection. If you have some idea, I will be gratefull. My function with sql : public function getResult($$value) { $...
-1
votes
0answers
19 views

I'm getting error while installing symfony application [closed]

I'm installing composer and symfony 4.12.4 application.in symfony documentation they run the command in console program.I don't know what is console and how to write code.Give some tips to solve the ...
0
votes
1answer
40 views

How to redirect old site URL to new Symfony 4 application URL using htaccess file?

I am in the process of migrating a static website to Symfony 4. I would like to redirect the old URLs to their corresponding routes in the new Symfony 4 app (while keeping the same domain name), like ...
4
votes
0answers
94 views
+100

Symfony 4 @Gedmo\SoftDeleteable() for form with collection type form

I have problem with soft delete item with form collection in Symfony framework I want to add and remove items in relation with Symfony form collection, If I remove item from collection this item must ...
-4
votes
0answers
58 views

How to a dynamically add roles to a user in Symfony 4?

Using Symfony 4.4.2. I'm trying to add roles to the current user dynamically (in memory, doesn't have to persist in DB), using an Event Listener. So I added a service: App\EventListener\...
1
vote
1answer
39 views

Nelmio API doc area and bearer token with symfony 4

I have API in Symfony 4. I added NelmioApiDocBundle to my project, but i have problem with my docs. This is my configuration: packages\nelmio_api_doc.yaml nelmio_api_doc: documentation: # ...
0
votes
0answers
37 views

Error in messenger during composer update symfony

I am trying to update my symfony installation from 4.1.7 but I receive the following error in my console: In MessenegerPass.php line 279: Invalid middleware: service "allow_no_handler" not found. ...
0
votes
1answer
17 views

Symfony 4 Adding/Updating Entities from Command

I have a command that i run from CLI to import data and create entries. $doctrine = $this->getContainer()->get('doctrine'); $em = $doctrine->getEntityManager(); /** @var ...
-1
votes
2answers
66 views

Symfony 4.4 FormType problem with validate

I have a problem with my validation form when I submit there is no error message just refresh the page and I don't understand what I have forget? I tried with SubmitType but I have the same problem. ...
1
vote
0answers
15 views

Post data contains list attribute in symfony

I have a manyToMany association between Tweet and Hashtag. I am trying to submit the Tweet form to create a tweet with the selected hashtags from the checked boxs. In addition, i'm using FosRestBundle....
0
votes
0answers
50 views

Symfony 4 - How to embed children in forms

Let's suppose I have this Document, a Model Tree Structures with Child References /** * @ODM\EmbeddedDocument */ class Link { /** * @var string * * @ODM\Field(type="string") ...
0
votes
1answer
26 views

Symfony 4.3 dynamic form for tags solution with Doctrine many to one association

First, I'm sorry for my bad english. I need to create form to adding new tags for Article but when I submit form then Request data is not handled in my form because new added tags are not in entity ...
0
votes
1answer
34 views

Join 2 tables linked by a 0..n / 0..n relation with PHP Doctrine ORM

I have 2 tables : User and Series. There is also another table: User_Series that symbolize what series a user follow. Since this table symbolize just a relation 0..n --- 0..n, a class for it wasn't ...
-1
votes
0answers
17 views

Translating this SQL Query into DQL

I'm looking for a translation of this SQL query into doctrine query builder in Symfony 4.3, My SQL Query : SELECT card_name 'Name', sets.name "Set" FROM cards INNER JOIN sets on cards.card_set = ...
1
vote
0answers
14 views

Symfony 4 with Material Bootstrap Select Picker not being submitted

Setup PHP 7.1.3 Symfony 4 Bootstrap 4 Twig 4.3 JQuery / Ajax All being run in docker containers (MySQL 8 and nginx) For styling, I am using Creative Tim's Bootstrap Material Dashboard (https://...
-1
votes
0answers
17 views

memoryleak: discrepancies in reported php memory and process memory

We discovered a memoryleak in one of our microservices (php7.4, symfony4.3, long-running cli process inside a docker container) and we cant figure out where it comes from. What it does: The process ...
-1
votes
0answers
12 views

Trying to do ManyToOne relationship where stored ID is encapsulated

Lets say I have two tables: Users id, class_id, name 1, #1#, John Smith 2, #2#, Joe Smith Classes id, code 1, Football 2, Soccer In an old version of the project I encapsulated the class ID in the ...
-2
votes
0answers
30 views

Symfony -> Composer require other project symfony

I have a problem with 2 project Symfony. First project is base / core for second Project. Composer will be require first project that correct in composer but... Executing script assets:install ...