Category "symfony"

Authorization Required - Error 401 only in firefox

I made a website and put it on a local Linux server. I can access it without problem on Chrome and IE but firefox outputs this : Authorization Required

FOSUserBundle overriding register form

I would like to override the register form from FOSUserBundle. I have followed this page: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resource

Twig - How to check if variable is a number / integer

How to check if variable is a number, integer or float? I can't find anything about this. Making project in Symfony 3.

RuntimeException: Unable to create the cache directory (/var/www/sonata/app/cache/dev)

I installed the Sonata admin bundle. After installation i refresh my page there is the cache problem then i use the following command to remove the cache: rm -

Sentry on Symfony: how to exclude `NotFoundHttpException`

I'm using the SentryBundle to integrate Sentry in my Symfony app. I don't want to record "NotFoundExceptions", so I configured the bundle this way: sentry:

Symfony Form / FormBuilder: How to add an option or attribute to multiple form fields

I want to add a stylesheet class attribute to most of the fields, but not all. public function buildForm(FormBuilder $builder, array $options) { $builder

How to import TomSelect in App.js to avoid browser error?

I'm working on a symfony 5.4 application that uses webpack / encore. I want to use the tomselect javascript plugin. i installed it with yarn and want to import

Symfony2 Doctrine merge

I am studying https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/working-with-associations.html but I cannot figure out what cascade merge

Symfony-Twig: insert fontawesome icon in a form_widget

To validate a form I am using a standard: {{ form_widget(form.save, {'attr': {'class': 'btn btn-sm btn-danger'}, 'label': 'Submit form'}) }} I want to insert

How to minify Symfony / Twig generated HTML code to satisfy Google PageSpeed Insight?

When testing my Symfony 2.8 based webpage with Google PageSpeed Insights I am getting warned, that the HTML code is not minified. This is true, while Assetic

Apply session id from request header

I am not sure if this is possible in Symfony so I came up with a question. The high-level scenario is: A request on the API (built in Symfony) must return the

insert ignore on duplicate entries in Doctrine2/Symfony2

How to ignore on duplicate entries using Doctrine2? Error example: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'symfony' for key 'UN

Symfony 6 - lexik JWT - Authenticator does not support the request

I'm having some problems with lexik JWT bundle and Symfony 6.0, for swagger I use NelmioApiDocBundle. The thing is, that every in swagger works before I decide

The method name must start with either findBy or findOneBy. Undefined method Symfony?

I am working through part4 of Symfony2, and while updating the controller and helper class code i got the following error message Undefined method 'getLatestBl

A circular reference has been detected when serializing the object of class "App\Entity\User" (configured limit: 1)

I am faced with a problem that gives me this error: A circular reference has been detected when serializing the object of class "App\Entity\User" (configured l

How to create tests w/Doctrine entities without persisting them (how to set id)

I'm working on tests for a Symfony2 project, and right now I'm looking for a way to create tests involving entity objects without persisting them. The problem i

Symfony 4 do not build in Production: Attempted to load class "WebProfilerBundle" from namespace

Symfony 4 do build in Dev mode but do not in Production mode while producing the error: Attempted to load class "WebProfilerBundle" from namespace. The WebPr

Symfony HttpFoundation UploadedFile "not uploaded due to unknown error" when using Doctrine DataFixtures

I've been using my Attachment entity based on the cookbook recipie How To Handle File Uploads With Doctrine in Symfony 2.3. It works well, even in functional t

Symfony post request body parameters?

I'm sending POST request by postman with header application/json and the body: { "name": "user" } And when I try to get this parameter from the request obj

Can't create a new Symfony project

I can't create a new Symfony project as described in the Symfony Documentation: https://symfony.com/doc/4.3/setup.html This is the command I use: symfony new -