Redirect to another page with data
I have a Javascript array in page 1 and i need it in page 2.I tried with JQuery post method but i couldn't make it work : $.post( "{{path('result')}}", mydata ); How do i properly redirect the user...
View ArticleHow can I edit the sql commands of symfony doctrine when updating a schema?
I have the following error when I'm trying to update my database schema :SQLSTATE[HY000]: General error: 1833 Cannot change column 'IdEcole': used in a foreign key constraint 'appartient_ibfk_2' of...
View ArticleAPI to download content as file
I would like to create an API which returns a text file. In Symfony I have a controller which is : throw $this->createNotFoundException($message); } $response = new Response();...
View ArticleSymfony Messenger: retry delay not working with Redis transport
I have a Symfony 4 application using the Symfony Messenger component (version 4.3.2) to dispatch messages. For asynchronous message handling some Redis transports are configured and they work fine. But...
View Articlesymfony4, api-platform upload file : Format "multipart/form-data" is not...
I would like to do an API with symfony 4, api-platform which allow to upload file and run a system commande with it and delete it. I want use in a controle somethink like :$uploadedConfig =...
View ArticleSymfony Check if at least one of two fields isn't empty on form validation
I've been turning this around in my head for quite a while now and still wasn't able to find a solution to my problem. Using Symfony 4 forms and constraints I'm unable to setup a check to say that at...
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 ArticleI am trying to get a list of users with their main picture in Symfony 4
I am having a hard time showing the main picture in a list of users. The query seems to do his job I can see in the log. These are my tables and code:table userid | usernametable metaid | user_id |...
View ArticleUpdate query with multiple where conditions
I am trying to update the row. Here I have multiple where conditions. This is the query I have tried. $this->createQueryBuilder("jv") ->update() ->set("jv.pictureStatus", "?1")...
View ArticleQuerying with the Query Builder
I'M USING SYMFONY 4.12 I'm trying to write queries to filter my jobs(I've job table ,départements one) I first try with experience but I'm stuck in here is my offerController:/** * @Route("/offres",...
View Articleneed help on symfony 4 [duplicate]
I'm trying to import Excel data to my database... here is my function but when I start the import I get this error on screen: Undefined index: C I use the PhpSpreadsheet library. public function...
View ArticleHow to return extra information from a voter in Symfony4?
I have a voter that I use to check if the current user can access an object. The access can be refused for several reasons, and I would like to know which in the Controller. However, the voter can only...
View ArticleEasyAdminBundle transliterator_transliterate error for file uploads
I have an EasyAdmin form field setup in easy_admin.yaml:- { property: 'imageFile', type: 'file_upload', type_options: { upload_dir: 'public/data/gallery/images/', upload_filename:...
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 ArticleRegister custom Doctrine type in Symfony4
So I have this custom Doctrine typenamespace App\Doctrine\Types;use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Types\TextType;class MyType extends TextType { private $prefix=''; public...
View ArticleHow to avoid multiple user sessions in symfony 4?
How can I prevent a user from accessing the site from multiple devices?I create a function onSecurityInteractiveLogin in a EventListener, but i can't get if the user is logged in other device and close...
View ArticleHow to import external routes in Akeneo 4.0
I'm building a custom bundle for Akeneo v4.0. I'm trying to import routes from that bundle to the rest of the app. So far I've done:# config/bundles.php <?php return [...
View ArticleCall js function from external file Symfony Twig
I'm having issues calling functions from twig views in Symfony 4.4. This view is called UserList.html.view and it extends base.html.twigThe beginning of the file is as following : {% extends...
View Articlempdf fails to open image when run from console command
I'm using Symfony 4.3 I have an InvoiceService, which generates invoice into pdf file. For html content I use \Twig\Environment::render() method. In the template I use twig asset() function for an...
View ArticleSymfony Doctrine query builder find entity with many to one relation
I'm building a website with Symfony for a project which will act like "booking.com" websites but much simplier and with some variations.Some errors on the database fields but not really important for...
View Article