Questions tagged [symfony4]
Symfony is a PHP framework developed by SensioLabs. Symfony 4 was released in November 2017.
4,003
questions
-1
votes
0
answers
15
views
Replicate Symfony 2.3 Encode Password algorithm In node js [closed]
We are working on symfony password encoder, so our project is 10 years old now we are moving all to Node.js and In that for old users all created password by using symfony encode password algorithm so ...
0
votes
0
answers
27
views
Undefined constant "OCI_NO_AUTO_COMMIT"
[critical] Error thrown while running command "make:entity Gabarit". Message: "Undefined constant "OCI_NO_AUTO_COMMIT""
[critical] Uncaught Error: Undefined constant &...
0
votes
0
answers
11
views
Failed to create object: error for Sonata_admin in Symfony 4
I get a very strange error when trying to create a new user using UserBundle with sonata-admin :
Failed to create object: App\Application\Sonata\UserBundle\Entity\User
with this error too when ...
0
votes
2
answers
41
views
Symfony service decoration, what does it actually mean?
I am new to Symfony. I read about service decoration but I don't still understand it. What does it actually mean to decorate a service in Symfony?
0
votes
2
answers
96
views
Validation password confirmation in Symfony
I have a problem when I try to create a validation of my registration form, I get an error
Invalid property path "passwordConfirmation" provided to "Symfony\Component\Validator\...
0
votes
0
answers
40
views
MJML to HTML slow
I'm having a little problem converting MJML to HTML in Symfony 4.
More in detail, when I want to send mail on redis it takes a long time, 2 mails per second for 1500 users.
Do you have any solutions ...
0
votes
1
answer
31
views
Uncaught PHP Exception LogicException: "Unable to add global "ea" as the runtime or the extensions
In browser, easyadmin is working fine. But when I run test case which asserts redirection logic to EasyAdmin's dashboard controller after login, it failed with the following error:
Uncaught PHP ...
1
vote
2
answers
93
views
Symfony: Calling a custom command from inside a controller
I couldn't find an answer to this.
Not sure if it's relevant to this issue, but my project runs on a Limactl VM in Ubuntu.
I am trying to call a custom command from inside my controller, but I can't ...
0
votes
0
answers
41
views
Symfony - Attempted to load class "SonataDatagridBundle" from namespace "Sonata\DatagridBundle"?
At this moment, I use Symfony 4.3, and I don't have any problem in dev.
When I want to install any specific new bundle , i have this error :
Attempted to load class "SonataDatagridBundle" ...
0
votes
0
answers
10
views
I have a problem with my symfony project when I try to exit()
I was trying to add data into the doctrine using:
$entityManager = $this->getDoctrine()->getManager();
$user = new User();
$user->setName('Oamogetswe');
$entityManager->persist($user);
...
0
votes
0
answers
34
views
Apparent CORS error hiding other error we can't find, looking for ideas
We are having trouble debugging an issue that looks like a CORS issue but it's finally not.
Our app randomly meets errors where requests do not complete. When we retry the same request, it works fine.
...
0
votes
1
answer
35
views
Find function won't fetch related entity in Symfony
I have a weird issue with Doctrine. I have set up the following structure:
Hers is ProfilRadnogMjestasPoslov Entity class
/**
* @ORM\Entity(repositoryClass=ProfilRadnogMjestasPoslovRepository::class)
...
0
votes
0
answers
67
views
Symfony + PdoSessionHandler: Data too long for column 'sess_data' at row 1
On my Symfony 4.4 application I use PdoSessionHandler to store session in the database. Yesterday I got an error log for one of the users:
SQLSTATE[22001]: String data, right truncated: 1406 Data too ...
0
votes
0
answers
20
views
formula in phpOffice
I use Symfony 4.4 and phpspreadsheet 1.28.0, how to enter a formula like $excel->setCellValue("D6", "=NB.JOURS.OUVRES(B4;B5)");
WHen I use this formula the page don't load
...
0
votes
1
answer
465
views
There is no extension able to load the configuration for "sentry"
I have this error in my symfony 4 project :
There is no extension able to load the configuration for "sentry" (in C:\SourceGit\Sentry\taxeapprentissage\config/packages/sentry.yaml). Looked ...
1
vote
0
answers
40
views
How to retrieve or update data inside Doctrine lifecycle events listener
In a Symfony4.4-based application, inside preUpdate() method of my event listener, I'm just trying to query an entity data from database using classic and known Symfony code to do so, for the sake of ...
0
votes
0
answers
52
views
symfony/vuejs authentification IS REQUIRED
I have a Symfony/Vue.js app, and I've hosted each one in a subdomain using Apache2. However, when I try to authenticate, I can't proceed, and I receive a 401 error indicating that full authentication ...
0
votes
0
answers
156
views
PHP Symfony EasyAdmin - configure actions - change newAction to handle collections
I have php symfony 4 app and in easy admin i want to change form from User list:
to User checkbox:
In my backend code to change above i changed code from:
if ($fieldId == 'user') {
...
-3
votes
1
answer
90
views
Unable to pass data to twig file from controller in symfony
I am trying to pass data from the controller to view, but when I passed the data am getting the following error
Variable "products" does not exist.
PLease find my controller code below
<?...
0
votes
0
answers
91
views
Attempted to call function \"exif_read_data\"
So I am running a symfony application where I need the exif_read_data(). I have enabled the extension in php.ini file but for some reason the extension is not loaded.
Dockerfile
FROM php:7.3.27-fpm-...
1
vote
0
answers
204
views
Unable to inject serializer service in parent abstract class in symfony 4.4
I'm just trying to inject the symfony serializer into an abstract class constructor, but that does not seem to work at all :
namespace App\DTO;
use Symfony\Component\HttpFoundation\Request;
use ...
0
votes
1
answer
441
views
PHP Symfony EasyAdmin - configure actions - cant find field choice
I dont know where i can find place to change field from list to checkbox.
I want to change form in EasyAdmin, in my field i have:
<div class="form-group field-entity">
and i want to ...
0
votes
0
answers
144
views
Symfony 4 parent abstract class does not set all its dependencies
I have an abstract class called CommonService with many properties passed through the constructor and this parent class has 3 children. Until now the children had to pass these depencencies to the ...
0
votes
0
answers
55
views
Very long loading time for symfony snappy bundle pdf generation
I have a project on symfony 4.4 that uses WhtmlToPDF and knp snappy bundle only locally everything works fine the pdf generation takes barely 3 seconds but as soon as I switch to FTP the loading ...
1
vote
0
answers
113
views
Symfony OAuth2 Bundle used as multi-tenant
I have started using https://github.com/knpuniversity/oauth2-client-bundle so I can implement AzureAD authentication per company. (I'm using this https://github.com/TheNetworg/oauth2-azure as the ...
0
votes
1
answer
182
views
Route function argument with default = null always being injected even when not passed in the URL
In an old Symfony 4.4 application I inheritted, I have two entities, Influencer and InfluencerManagement.
The Influencer has an influencerManagement (represented by influencer_management_id in its DB ...
0
votes
0
answers
189
views
Symfony, doctrine, API platform - problem with filter
I get my data into Vue Js app with API platform mechanism called - “properties[]”. My URL look like “http://address/resource?properties[subresources]=id. I have custom doctrine extension to checking ...
0
votes
0
answers
80
views
Symfony run event after expiration command
I develop in symfony 6 as part of my application. I have to do a task where a User XYZ create an order. after X time (30 minutes for example) certain actions are done on this order automatically ...
0
votes
0
answers
226
views
Symfony 4.4 http_client service "Couldn't resolve host name" issue
I use on a project the http_client service of symfony (v4.4) to call an external API.
Everything works fine on staging and production.
But in local development, I have a frequent error indicating :
&...
1
vote
0
answers
89
views
Error for file validation then using symfony validator as standalone class in my php project
I work on a PHP project and implement Symfony validation as a standalone class. Everything is ok, but when I try to validate the file I have an error and I don't know how to solve it. Can somebody ...
0
votes
0
answers
74
views
Phpspec with Symfony 4+ how to test Controller that uses AbstractController functions
Any test case that uses anything from Symfony AbstractController can not be really tested... or can it?
Simple example:
class TestController extends AbstractController
{
public function index()
{
...
0
votes
0
answers
55
views
Symfony template override doesn't work on production
I am working on an app written with Symfony 4.4.
It uses the EWZRecaptchaBundle to handle captchas.
However, this bundle doesn't deal well when there are two captchas on the same page.
To address this ...
0
votes
1
answer
98
views
Use kernel.environnement in Symfony Expression Language
I am using Symfony 4.4 and I want to grant access to some routes only in dev or test environments.
My route is defined (using Api Platform) in the entity by:
* "postUserTest"={
* ...
0
votes
0
answers
94
views
Got warning: 'WARNING [cache] Failed to save key' after update doctrine configuration
I got a warning: 'WARNING [cache] Failed to save key', after trying to update the doctrine configuration. this error appears when i run bin/console.
I tried updating the doctrine configuration to get ...
0
votes
0
answers
47
views
Unwanted characters in Doctrine cache
We are using Redis for as the caching driver for Doctrine in Symfony4.4. We are using the Doctrine's metadata_cache_driver, query_cache_driver, result_cache_driver which saves the cache data into ...
0
votes
0
answers
68
views
How to configure optional authentication to an endpoint in Symfony 4.4?
I would like to configure an optional oauth2 authentication to an endpoint.
The behavior I want is this:
If the request is authenticated, i.e., the user is logged in, I can get the user UUID from the ...
0
votes
0
answers
15
views
Symfony randomly no response fom server
i have a strange problem with a Sonata/Symfony project. Randomly the site is not available. It seems that there is a process blocking all other requests from any other user / client. The webserver / ...
0
votes
1
answer
124
views
Symfony Make Entity issue
Class name of the entity to create or update (e.g. DeliciousPuppy):
test
created: src/Entity/Test.php
created: src/Repository/TestRepository.php
Entity generated! Now let's add some fields!
You can ...
0
votes
0
answers
118
views
Symony 4 command: log in production
I have a Symfony command which is executed under a cron entry and I need some log in production environment.
As I read here in production, for console commands, verbosity level is related to log level ...
0
votes
0
answers
131
views
Unable to use StreamedResponse In Symfony 4 to display a text line by line as it's
I'm trying to display to a user a text line by line. The text is retrieved from a Python rest endpoint in a streaming response. I tried it out with cUrl, it works just fine.
I'm trying to call this ...
0
votes
1
answer
46
views
SF4: multi authenticators with default authenticator
I hope that it will be clear. I have a very old application that was upgraded to SF4.4 some time ago and all time is maintained and developed. Unfortunately has a lot of old code. I have to create a ...
0
votes
0
answers
118
views
Symfony 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(...
0
votes
0
answers
100
views
non-existent service "http_client" while upgrading symfony 4 to 6
I'm migrating a Symfony 4 app to Symfony 6. Symfony like change everything in next major version.
I'm supposing the problem come from api platform but not really sure.
!!
!! In ...
1
vote
2
answers
1k
views
Symfony 5 - Doctrine with schema_filter not working
I try to ignore two entities when I execute the command line doctrine:schema:update --force in my project who is writing like this :
/**
* @ORM\Entity(readOnly=true)
* @ORM\Table(name="...
0
votes
0
answers
70
views
Twig\\Error\\RuntimeError status 500 mailjet API
In a symfony project,
I use an API mailjet to send emails,
In case of sending lots of email (over 290 emails), I have this error.
Status Code: 500 Internal Server Error
Runtime exception
Thanks!
After ...
1
vote
0
answers
116
views
Symfony - Sylius : Symfony VarDumper server no output inside console
Context
I'm trying to use the Symfony VarDumper server to debug controller calls from an external API.
I'm a using Sylius 1.11 : the Symfony VarDumper is already as a core dependencies of the ...
1
vote
1
answer
42
views
Service \"AppBundle\\Service\\Report\\Generation\\ACN\" not found: even though it exists in the app's container, the container inside
I'm trying to get a service from the container
if($responseType == 'json') {
$generator = $this->container->get('AppBundle\\Service\\Report\\Generation\\ACN');
I set it as public
...
0
votes
0
answers
162
views
Mapping problem with Symfony 4 and Doctrine 2 on multiple schemas
I'm working on rewriting an old plain PHP bad written app with Symfony 4.4 and Doctrine 2.12. Due to the number of databases (5) and the XXL size of them (at least 50 tables per database with often ...
-1
votes
1
answer
129
views
How to transfer finished Vue app to symfony?
i got almost fully finished Vue frontend app and i need to move it inside symfony. I am already using webpack-encore bundle and i kinda have it. But when i am importing Vue inside an axios or vuetify ...
0
votes
0
answers
227
views
An exception occurred while executing 'SELECT NEXTVAL
I have an error I don't know why when I want to insert data in database? the same code in local machine works fine but in remote host it show this error :
An exception occurred while executing 'SELECT ...