Overriding checkbox form field producing duplicate label and no field in...
I am having trouble overriding a checkbox field in my Symfony form inside my Twig template.I am building the field with the following code in my Twig template:{{ form_row(form.legal, {'label' :...
View ArticleI clear the cache after deployment to production but also lose my app cache....
To deploy, I 'git pull' then 'bin/console cache:clear' to see the updates to my website.It works, but I don't want to lose MY cache pool's data when this happens. (I cache results to 3rd party api...
View ArticleSymfony 4.4 Declaration of...
I recently upgraded my project from Symfony 3.4 to 4.4. I am stil working on the upgradation but I am stuck in this Fatal error which saysCompile Error: Declaration of...
View ArticleCommand "make:entity" is not defined. Symfony 4.4
when I runphp bin/console make:entitythe output is[critical] Error thrown while running command ""make:entity"". Message: "Command "make:entity" is not defined.Did you mean one of...
View ArticleImplement a custom error controller in Symfony 4.4
What i have done:I have created this custom controller cause I want to pass to the error pages some extra variables.#Controller/CustomErrorControler.phpnamespace App\Controller;use...
View ArticleHow to test a Form having a field being EntityType in Symfony
(Using framework Symfony 4.4)I try to learn about how to test a Form having a field being an EntityType form field.See exemple bellow :class VaccinationType extends AbstractType{ public function...
View ArticleSymfony Dependency Injection shows a weird behaviour
When I try to inject a service in my Symfony 4.4.25 Bundle (with Akeneo) I encounter a very strange behavior.Defining a mapped variable in the Bundle Config without having the variable in __construct()...
View ArticleIssue while installing symfony/maker-bundle
I'm dealing with an application created with symfony 3.4 and updated to symfony 4.4, I need to update doctrine/inflector to 2.^ version to install symfony/make-bundle, with:composer require...
View ArticleHow to properly use '%' for escaping YAML configuration in Symfony?
When it comes to creating bundles, it's often necessary to support some configuration for the developers who'll use the bundle.In this case, I need the configuration's value to support %someText%,...
View ArticleCustom base entity in Symfony 4
I am using Symfony 4 and with Doctrine where I have entities which have the same common attributes such as createdWhen, editedWhen, ...What i would like to do is this:Defining a kind of base entity...
View ArticleHow to add image in the twig template?
It start getting bit annoying now. My images are inside public/images/ folder. I am trying to add an image to the my TemplatedEmailIn my twig template, I have tried everything I found in the...
View ArticleSymfony 4: allow only active accounts to login
So I'm using symfony 4 and I managed to add a field in the user's database table called "Active", if active equals 0 then the account is not activated and vice versa.So what I'm trying to do is that...
View ArticleKnpPaginator does not work with FosElastica after update
I'm trying to update an existing dockerized Symfony project - developed in 2019 - from 4.4.19/PHP7 to 4.4.37/PHP8So I've created a new empty project using the last version of Symfony4 and installed all...
View ArticleSymfony 4.4 ignores env variables
I've just migrated my project from 3.4 to 4.4 and having a trouble to configure it correctly. My project is running inside a Docker container. I provide an env variable DATABASE_URL with a production...
View ArticleSimulating auth in tests for Symfony 4.4 with ZenstruckFoundry
In Symfony 4.4 I am attempting simulate authenticating a user so that I can write PHPUnit tests for a secured area of my application. I am using the ZenstruckFoundry to create a factory for my User...
View ArticleJsonResponse returns the json response plus the request data in string format...
I'm making post requests using ajax in my symfony 4.4 project, and i return the response using fosrestbundle, sometimes it returns a correct json response but sometimes, the response includes also the...
View ArticleInvalid configuration for path "sentry.options.integrations.0": Expecting...
I'm setting sentry in Symfony4.4 to ignore some types of exceptions. Following the doc, I set config.yml this way:sentry: dsn: "%sentry%" register_error_listener: true options: attach_stacktrace: true...
View ArticleAfter upgrading symfony from 3.4 to 4.4(without flex) getting service or...
After updating symfony from 3.4 to 4.4(without flex) i am getting this error The "tactician.commandbus" service or alias has been removed or inlined when the container was compiled. You should either...
View ArticleI have an error whe I try to reset my passord using ResetPasswordBundle
I have an exception whe I try to reset password in my app. I use Symfony 4.4 and and installed "symfonycasts/reset-password-bundle": "^1.13", the controller is the next:class ResetPasswordController...
View Articlecreating a Symfony 4.4 project on windows using composer 1.10.26 : Script...
Since yesterday, I have a problem creating a project with the command: composer create-project symfony/website-skeleton:"^4.4" my_project_directory on windows. I used php 7.3 symfony 4.4 composer...
View Article