Upoaded image's too big : a circular reference occurs
I'm trying to build a subscription form with Symfony4 and I tought it was working but it appears that when I try to upload a profile picture that is too big, I've got the following error : A circular...
View ArticleChange database connection in Migration class in Symfony
In migration class depending on logic, I need to use different types of database connections. How in migration class to get new connection by connection name? Currently in doctrine.yaml file I have...
View ArticleEmbedded form render wrong input type
To allow customisation of the registration form, some form fields are generated from database informations and the form in embedded into the registration form. While each fields of the embedded form...
View ArticleDoctrine only inserts one record after foreach loop
I have a simple array with some values that need to be inserted into the DB. Out of all the values only the last one is actually inserted. When I put the flush(); inside the loop, records do get...
View ArticleHow can I stop Symfony Console from converting notices to exceptions
I have issues with custom commands in Symfony Console failing hard due to notices being converted to uncaught exceptions. My code causes some E_NOTICE due do deliberate coding decisions. Mostly these...
View ArticleApi Platform with Swift Mailer
I would know if API Platform is reliable to Swift Mailer. In fact, I woul use Swift Mailer to send a email when a new task has add. It works good when I use my controller, but not working with Postman...
View ArticleHow to get the current session array count in twig?
In my bootstrap file where I instantiate my twig I have: $twig->addGlobal('cart', $session->get('cart')); and in top navbar of my twig I have a badge to show how many items are in added in cart...
View ArticleHow to create a spinner field with symfony form?
I want to have a spinner in my symfony form: <input type="number" /> It seems symfony does not have such form field type? and it seems their custom form field type is not for this job?...
View ArticleHow to display a datepicker on Symfony?
I want to set up a date-picker for my date type fields based on symfony documentation. I have installed the package since packagist 'eternicode / bootstrap-datepicker'. I am able to apply my defined...
View ArticleDoctrine get relation IDs with queryBuilder of OneToMany
I am starting to use Symfony 4 and Doctrine. I have these entities with composite keys: /** * Shops * * @ORM\Entity */ class Shops { /** * @var \App\Entity\Registers[] * *...
View ArticleHow to fix "but the new value must be an array or an instance of...
I build a management app of bagages and voyages with Symfony 4, I created a "ManyToMany" relation between this entities. When I want to add a new bagage with a destination (voyage) I have this error :...
View ArticleApi Platform custom swagger/openapi context body
I am using Api Platform with Symfony 4, and I want to create a custom endpoint. Everything works fine, but I cannot change 2 things: body and response format (in openapi documentation). Parameters and...
View ArticleSet custom port when starting symfony local web server
I want to start a server with symfony server:start using the port that is set in my .env file. Is there a way to do this?
View ArticleMust fix var folder permission after each cache clear , Symfony 4
I'm using Symfony 4 and my website is hosted on ubuntu 18.04 server. The problem is each time when I do clear cache I must run chmod 777 -R var/ . Is there a command to fix permission permanently ?
View ArticleSonataAdmin create entity with boolean field
I have this entity, if I create a record like this. $synopsis = new Synopsis(); $synopsis->setPartOne("a"); $synopsis->setPartTwo("b"); $synopsis->setTitle("A");...
View ArticleHow to import an existing database that not contain primary key in Symfony4?
I want to import an existing database that not contain any primary key. What should I do with the command line? I have changed some code in my DatabaseDriver.php This is after I have changed the code...
View ArticleUnable change Swagger UI location path
I made an api with api-platform. I tried to edit the swagger_ui path '/' to '/docs' according to api-platform documentation and allow '/' redirect to custom twig i made. The swagger_ui documentation...
View ArticleHow to pass variables from jquery fetch function to symfony routes.yaml?
So I want to call a controller in symfony by passing in my route declared in routes.yaml with a jquery fetch function and I want to pass to variables from jquery to the controller. How can I do that ?...
View ArticleConvert string to timestamp in symfony 4
I have a variable recover from ajax and in the controller dd($gethour); "Sat Oct 26 2019 00:00:04 GMT+0200 (heure d’été d’Europe centrale)" $from = \DateTime::createFromFormat('m-d-y H:i:s',...
View ArticleSymfony4 deploy to shared hosting getting error 500
I have deployed my symfony4 project to a shared hosting (infinityFree). but when I go to my website I get a 500 Internal Server Error : Oops! An Error Occurred The server returned a "500 Internal...
View Article