Api platform - invalid IRI instead of validation error
I'm using API platform for my booking application.Booking has many to 1 relationship with a department. When I create a new booking by sending a POST request with an empty string as a value for the...
View ArticleDenormalizer on MongoDb Embedded Document in Symfony API Platform
I am attempting to run a denormalizer (data in) on an embedded mongodb document with Symfony 4.4 using the Api Platform bundle. This works as expected for normalization (data out), but for the...
View ArticleVirtual hosts configuration with Symfony
I have a problem with my virtual host on WAMP server. I tested projects that I worked on before, and they all work. When I hit my localhost name of the project 127.0.0.1 project.local defined in my...
View ArticleSymfony Codeception functional test: environment variable not found
I'm using Codeception v2.4.1 with PHPUnit 7.1.3 in a new Symfony 4 project.I created a functional test, and attempt to run it, and receive an error: ./vendor/bin/codecept run functionalThere was 1...
View ArticleSymfony 4 OneToOne relationship not pulling from database
This issue is so weird!Example structure of entities relating to each other:Property -> InstructionToSell (OneToOne) -> acceptedOffer (OneToOne)If I do something like:$property =...
View ArticleSymfony forms : Set an embedded field to null
Hy,I'm on Symfony with MongoDb. I have a problem when I want update a document. This one has an embedded field. If I give it a not null value on POST, I can't update it to null when I patch.When I POST...
View ArticleUsing the resolve operator in the Symfony config env() helper
This article introduces type-casting and some convenient operators which can be used inside the env() helper in the Symfony configs. Everything's clear except the resolve: operator. The article...
View ArticleSymfony 4: files in environment folders suddenly not executed anymore
I am a relative symfony beginner, I have a strange effect of the files in environment folders suddenly not being executed anymore. I did seemingly nothing out of the ordinary, I rely on these files...
View ArticleSymfony: Validate array of models before group persist
I had group of objects which extends abstract class. I validate it in models. When I insert it one by one its everything ok, but now i wanna add possibility to import it from files. I had all logic to...
View ArticleSonata admin sortabe listing, fields are blank
Im trying to make a simple sortable system on one of my tables in the sonata admin bundle, i have followed this tutorial...
View ArticleIn Symfony 4,The server returned a "500 Internal Server Error"
Using Symfony 4. In my local environment everything is okay, but in production server it is showing the following error,The server returned a "500 Internal Server Error". Something is broken. Please...
View ArticleHow to add the input username in fosCommentBundle without fosUser?
I want to add the Username field (input) in bundle FOSCommentBundle without using FOSUserBundlde.the user must enter his username and comment. The basic model does not offer the pseudo field because it...
View ArticleSymfony 4 is painfully slow in DEV
I try to run a simple Symfony 4 project on a docker container. I have tested regular PHP scripts, and they work very well. But, with Symfony project, the execution gets ridiculously slow. For example,...
View ArticleHow to change parent entity on inherited entity in Symfony4 Doctrine
I have multiple entity type which extends each other in order to create my model. In my application I need to manage Interimaries, Employes and Users.An Interimary is working in a company, as is an...
View ArticleSymfony 4 : How to make an eventListener
Now I'm training on event management on Symfony.So far everything is going well!I have the following code:When a user connects to the application, a listerner detects the connection event and updates...
View Articlesymfony 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, she...
View ArticleSymfony 4 redirect 404 error to my controller
I'm trying to catch the 404 error and redirect it to custom controller, so I could get some data from database. I find this article https://symfony.com/doc/4.4/controller/error_pages.htmland overide...
View ArticleCKFinder error when browsering (Symfony4 + EasyBundle + CKEditor)
Here's my stack :Symfony4 EasyAdmin WebpackFOSCkEditorCKFinderAnd here's my problem :I got a form with a WYSIWYG field, and when I click on the "Image" icon, a popup open with all the properties of the...
View ArticleHow to start a Symfony server with environment variables from .env.test?
Is there any way to start the build in server with environment variables like DATABASE_URL from other environments like .env.test instead of .env?I want to use diffrent databases for dev and test but...
View ArticleHow to listen to the log out event to record the event on the database?
When a user connects to the application, a listener detects the connection event and updates the last_login_at field for the user.The problem appears when the user wants to log out.When disconnected,...
View Article