1,127 questions
0
votes
0
answers
18
views
Doctrine persistence in Symfony 5
I'm struggling with entity persistence. When I associate an existing object (eg: AccountType) to a new one (eg: User), it always tries to create a new AccountType entry. If I add cascading, I have ...
0
votes
0
answers
62
views
Doctrine not saved relation when saving child entity with setting parent entity object
Here is example of mapping:
Cateogory mapping:
<entity name="App\Core\Domain\Post\Item" table="post_item">
<id name="id" type="integer" column="...
0
votes
1
answer
76
views
Fetch Excel files which contains worksheets but without localized contents
I have issue with preparing query in Symfony5 and Doctrine.
I have relation Excel -> Worksheets -> LocalizedWorksheetContents. My goal is to fetch Excel records which worksheets don't contain ...
0
votes
0
answers
45
views
Dynamic CollectionType in Symfony FormType
I have one Parent and three child FormTypes:
ParentFormType
ChildOneFormType
ChildTwoFormType
ChildThreeFormType
All thee child classes inherit from parent.
So, here is my Form class
class MyFormType ...
0
votes
0
answers
110
views
Attempted to call function "ftp_ssl_connect" from namespace "App\FTP" [duplicate]
I wanted to execute my make sf_console c="ftp:download" command which is located in the Command folder and I got this error
Attempted to call function "ftp_ssl_connect" from ...
0
votes
0
answers
54
views
No database selected error - symfony pimcore 11
I am upgraded my pimcore 10 to pimcore 11 then using symfony 5.
My problem is when I am running this command
php ./bin/console pimcore:bundle:install PimcoreAdminBundle
I am experiencing this error
...
-1
votes
1
answer
151
views
Timeout issue when smtp server is downl with a site using Cloudflare
I'm using Symfony\Component\Mime\Email to send emails with try/catch. Locally when the smtp server (mailhog) is down the try/catch works well. But in prod, if the smtp is down, the page loads for ...
0
votes
0
answers
110
views
Bootstrap dropdown navbar script not loading in Symfony CLI version 5.10.4 using importmap
I'm new to Symfony and I'm trying to do an app from command
symfony new 'app_name' --version=6.4 --php=8.3 --webapp --docker --cloud
importmap seems to work fine and bootstrap css has been loaded well,...
0
votes
0
answers
23
views
Unable to open a connection with phporientdb
I am working on a demigratio sydmfony project towards version 5.4, and I have not been able to connect to my orientdb database. In this project we use ostico/orientdb, here is the error message:
An ...
0
votes
1
answer
57
views
Listening to the Ticking of a Symfony made checkbox with javascript
I need to listen to the click of a checkbox created and displayed in the view through Symfony5 formBuilder and within a sonataAdminBundle interface. The point of this being to adapt some other field ...
0
votes
1
answer
105
views
Serialized Object to JsonResponse return empty response using serializer service in Symfony 5 Controller
I use to add vue3 frontend content in a backend symfony 5,
I need to return a jsonResponse for sorting values in the front,
I did a Serializer Service to Serialize in Json an object which is from the ...
-1
votes
1
answer
104
views
Gitlab CI runner running in Symfony DEV env for PHPUnit tests despite configuring it for TEST env
I am having difficulty in getting my PHPUnit tests for my Symfony 5.4 application running in a Gitlab runner.
My .gitlab-ci.yml:
phpunit:
stage: test
image: php:8.2-alpine
variables:
...
1
vote
1
answer
118
views
Symfony 5.4 Rendering custom template form CollectionField with a custom type
How can I make thus field use the template?
Following the documentation does not seem to help. What am I missing?
I'm trying to render it on this crud controller field:
$translationContents = ...
0
votes
1
answer
98
views
Symfony5.4 → 6.4 RememberMe is not recognized and logs me out when I set it as a cookie
Expected behavior
In order to upgrade from Symfony 5.4 to Symfony 6.4, we have removed the currently deprecated "TokenBasedRememberMeServices" and implemented the new RememberMe autologin ...
-1
votes
1
answer
614
views
Symfony 5.3 deprecation: from `SessionInterface` to `RequestStack->getSession()`, but throws `SessionNotFoundException`
On a Symfony 5.4 project, I am trying to get rid of this deprecation
Since symfony/framework-bundle 5.3: The "Symfony\Component\HttpFoundation\Session\SessionInterface" and "...
1
vote
0
answers
40
views
Shopware 6.4 Cart Validator always returns NULL for LineItem getQuantityInformation Method
I have a Custom product which when added to cart, I intend to validate the cart and ensure the custom product meets certain criterias before checkout.
Please see Shopware Documentation: Add Cart ...
0
votes
1
answer
362
views
symfony "fileperms() stat failed for" error
I work on an application with symfony and upgrade it from 5.4 version to 6.4.
Since, I can't cache:clear without to get many errors :
With cache:clear -vvv I get :
07:40:33 DEBUG [php] Warning: ...
1
vote
1
answer
674
views
Compile Error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::handle(array $record): bool must be compatible
I am upgrading symfony 4.4 to 5.4 using PHP 8.2 after run composer update command then i am facing this issue.
ERROR: Compile Error: Declaration of Symfony\Bridge\Monolog\Handler\ConsoleHandler::...
0
votes
1
answer
35
views
Syntax Error line 0, col 70: Error: Expected Doctrine\ORM\Query\Lexer::T_INSTANCE, got '.'
I want to make a request to retrieve elements from my table that contain a property called 'stat.' This property is a discriminator. When I retrieve the elements based on the discriminator as in the ...
2
votes
1
answer
146
views
Symfony type hinting for custom User class
I am trying to get type hinting to work with a custom User class in the Symfony 5.4 Security bundle and PHP 7.4. So I have this User class:
// src/Security/User.php
<?php
namespace App\Security;
...
0
votes
1
answer
217
views
Checking request requirements in PHP Symfony: Do I have to use services? (OOP vs Services in Symfony) [closed]
I'm working on my second Symfony project and trying to follow best practices. I've switched from static methods to services for improved readability and potential performance gains. For instance, I ...
2
votes
0
answers
167
views
Key provided is shorter than 256 bits, only 64 bits provided
Since I updated 2FA in order to put trusted device, I get this error after the login and security code entered:
Key provided is shorter than 256 bits, only 64 bits provided
I updated my User entity ...
-2
votes
1
answer
316
views
scheb/2fa not detected/working on my project
Bundle version: 6.1
Symfony version: 5.4
PHP version: 8
I wish to add two-factor authentication to my project and I came across your solution which seems great to me. Initially, the installation ...
1
vote
0
answers
77
views
Why Swagger UI array type field generates a string
In symfony54, API controller, i have
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="multipart/form-data",
* @OA\Schema(
* @...
0
votes
0
answers
103
views
Why my use statements are case sensitive in one environment and not in the ther one?
Few days ago I faced a problem in my production environment. Let's say I've got a FOOClass.
When I tried to use it in another class, I made a typo in the use statement like so use My\Namespace\...
0
votes
1
answer
152
views
Symfony 5.3.9 manually logging out logged in user and log in in another user
I am using symfony 5.3.9, what I want to achieve is when I click on a button (vue 3 as front end), I call a function
like this:
public function __construct(TokenStorageInterface $tokenStorage, ...
1
vote
1
answer
2k
views
Symfony Doctrine DBAL Error: Unknown column type "json_array" requested after upgrading to DBAL 3"
I runed the command composer install in my Symfony project. However, when I attempted to run the command symfony console doctrine:schema:update, I encountered the error message:
Unknown column type &...
0
votes
1
answer
99
views
Issue with EntityType Querybuilder
So my problem is that whenever im sumbitting my form after filling in it gives me an error Expected argument of type "string", "App\Entity\User" given at property path "...
0
votes
1
answer
197
views
Mocking external clients (f.ex: AWS SDK SQS Client) when testing a symfony command
[PHP] [Symfony 5.4] [Testing]
Hello!!
I am trying to add some test coverage to a symfony project. The service I am trying to test is a symfony CLI command.
The setup looks something like this:
...
0
votes
1
answer
357
views
Integrity constraint violation for Symfony User
I'm getting this following error
[Application] Jan 5 00:03:10 |CRITICA| CONSOL Error thrown while running command "make:migration". Message: "An exception occurred while executing a ...
0
votes
1
answer
506
views
Symfony 5.4 .env.test does not overwrite .env when using phpunit
I have upgraded Symfony from 4.4 to 5.4. Every dependencies have been upgraded and recipes installed.
I have a .env and a .env.test (nothing else in terms of dotenv).
I also have a phpunit.xml.dist as ...
0
votes
1
answer
81
views
How do I set a custom method if unallowed method is used
My Route is a POST route. What I want is that if someone makes a GET request then it should give my own custom JSON message instead of the below one. I even did the following but the code is crashing ...
1
vote
1
answer
62
views
How do I make API routes accessible without login?
In security.yml I have defined below:
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/api/getDays, roles: IS_AUTHENTICATED_ANONYMOUSLY }
# - { ...
1
vote
0
answers
698
views
Decorate a Shopware 6 core service without modifying the abstract class
After decorating a Shopware 6 core service and adding a new method, how do you use the call up the new method. I am not allowed to modify Shopware 6 bundle code base.
Example:
//abstract class begins
...
1
vote
1
answer
267
views
How Do I Solve This Shopware Error The definition for Pugil/Core/System/NumberRange/ValueGenerator/Pattern/ValueGeneratorPatternLanguage has no class
How Do I Solve This Shopware Error The definition for "Pugil/Core/System/NumberRange/ValueGenerator/Pattern/ValueGeneratorPatternLanguage" has no class. If you intend to inject this service ...
1
vote
0
answers
52
views
Id not found when changing a OneToMany relation to a ManyToMany relation
I have a working OneToMany relation between my class Devis and my class Dossier.
This is my class Devis:
/**
* @ORM\Entity
* @ORM\Table(name="devis")
* @ORM\Entity(repositoryClass="...
-2
votes
3
answers
882
views
Symfony run fails on docker installation [closed]
I get the following error when I try to run my Symfony project via docker compose. Here is the error:
Script cache:clear returned with error code 255
!! Symfony\Component\ErrorHandler\Error\...
0
votes
1
answer
126
views
Symfony 5: ManyToMany Relationship Not Persisting When Added from MappedBy Side Without 'by_reference' => false
Context:
I'm working on a Symfony 5 application with entities InventaireActif and TypeActif having a ManyToMany relationship. An issue arises when managing this relationship through a Symfony form.
...
0
votes
1
answer
461
views
HMAC authentication of secret and payload in Symfony 5.4
My JavaScript code is making the following POST API call to my endpoint:
const payload = {
course: args,
recipient: roomId
};
const signature = this.calculateSignature(JSON.stringify(payload), ...
-1
votes
1
answer
106
views
Symony 5 PHP : Possible solutions handling whitelabel routes
I've come back to Symfony after a long time in order to make things more accessible for other developers and properly integrate it in someone else's project.
The problem I'm facing is that my project ...
-1
votes
2
answers
156
views
How to collect Symfony cache metrics in production? [closed]
I am using Symfony 5.4 together with Shopware 6.4
I would like to collect metrics about the cache usage like hits/misses in production.
This should be done in a way that doesnt impact production ...
1
vote
1
answer
449
views
Time zone detection by city/country name php 8.1 / Symfony 5.4
What are the ways to get the time zone given the city code in php8.1 with Symfony 5.4?
0
votes
1
answer
325
views
Symfony entity with field of type JSon leads to error with DoctrineExtension Translatable method translate
Using Symfony 5.4 and stof/doctrine-extensions-bundle 1.7
I have an project with existing data in two languages. While asked to add some more languages I try to implement Translatable of the doctrine ...
0
votes
1
answer
30
views
how to check a choicetype box as default
How do I check PMTool checkbox as default? Also I don't want this to override the data when I modify the existing user.
-> add('raw_roles', ChoiceType:: class, [
'label' => 'User access',
...
-1
votes
1
answer
449
views
Symfony how to configure login in popup with AJAX request
Symfony >= 5.3
app isn't API
app isn't SPA
don't use FOSUserBundle
Do I need to set json_login setting in security.yaml?
Do I need to set custom_authenticator setting in security.yaml?
I ...
0
votes
1
answer
48
views
Custom Default Terms&Conditions Checkbox in Symfony 5
I'm new to symfony and I'm trying to build my Sign up page. Generated the form and fields through my FormType, but I kind of want to change how the terms and conditions' checkbox looks.
It's label ...
-1
votes
2
answers
56
views
composer update is not downloading anything [closed]
In a Symfony 5.4 project calling
composer update
stops (or is not proceeding) when the downloading part should process.
It lists all the things to download like this
Downloading php-http/discovery (1....
-3
votes
1
answer
800
views
Symfony 5.4 with Kafka [closed]
I have a symfony 5.4 project and I want to implement kafka with the symfony messenger component.
I've seen several ways to do this, including this post: Symfony Messenger with Apache Kafka as queue ...
1
vote
0
answers
102
views
After migrating pimcore 6.9 to 10.6 successfully, admin interface has router issue
After migrating pimcore 6.9 to 10.6 successfully, admin interface has router issue
I have changed routing as per symfony flex document, But getting this error
Also please help me to organize existing ...
0
votes
2
answers
2k
views
View TextEditorField as html in detail modal in easyadmin
I use EasyAdmin to manage the back office of my site created with Symfony 5.
One of my entities has a TextEditorField type field that I use with CKEditorType for forms. In the forms no problem I can ...