Questions tagged [symfony-3.4]
This is the Symfony 3.4.x specific tag. Use it in addition to the symfony3 tag if your question is specific to Symfony 3.4.x — not just 3.x.
929
questions
0
votes
0
answers
5
views
Issue related to setup of Symfony 3.4
I have installed PHP 5.6.40, and have also run command
symfony check:requirements
in accordance with https://symfony.com/doc/3.4/reference/requirements.html
Its output is shown below.
/usr/local/bin/...
0
votes
0
answers
24
views
Symfony3 returns "internal server error 500" only in prod
we are getting this 500 error but only in prod environment. This app works fine in DEV/QA env
Even in prod this app works fine until you send a form to edit some data in data base. Then, when
debuggin ...
0
votes
0
answers
18
views
Monolog logs hitting later handlers even when bubble=false
I have an issue where I have tried configuring the main logger in my Symfony project to be of the fingers_crossed kind with a threshold of warning. Still, I am getting DEBUG and INFO logs in ...
0
votes
0
answers
106
views
After upgrading symfony from 3.4 to 4.4(without flex) getting service or alias has been removed or inlined when the container was compiled
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 ...
-2
votes
2
answers
66
views
How to setup a Doctrine test to have automatic rollback of the transaction (to avoid dirtying db)?
I would like to have tests dealing with Doctrine not persist stuff in the main Symfony dev database. Preferably by not storing stuff at all (rolling back per test). How would I do this? Are there ...
0
votes
1
answer
55
views
Symfony 3.4 - Dependency Injection for ResettingController of FosUserBundle work only in dev env
My initial problem is this error:
Too few arguments to function
FOS\UserBundle\Controller\ResettingController::__construct(), 0 passed
in
/var/www/project/vendor/symfony/symfony/src/Symfony/Component/...
0
votes
1
answer
24
views
Sonata admin get existing query builder
please help to find out the following:
I have the following code:
/**
* @param FormMapper $formMapper
*/
public function configureFormFields(FormMapper $formMapper)
{
$formMapper
->...
1
vote
0
answers
53
views
Upgrading symfony project v2.8 to 3.4 - doctrine migrations error: The version "latest" couldn't be reached, there are no registered migrations
Currently when trying to run migrations I am receiving this error:
[ERROR] The version "latest" couldn't be reached, there are no registered migrations.
My doctrine_migrations.yaml is:
...
0
votes
0
answers
17
views
Symfony 3.4 Cache clear after every change in Code
I have older project on Symfony 2.8. Now i am moving / upgrading it to 3.4 framework on php version 8.
I have installed new framework of symfony 3.4 and copying old files into new and making changes ...
1
vote
0
answers
56
views
Returning JSON array in (old) PHP Symfony
Be gentle, I'm a hacker not a professional developer!
I think I'm close, but I am getting tripped up by the different ways that a Controller can retrieve data and return it as JSON (to a data table). ...
0
votes
1
answer
44
views
RenderView in Symfony Helper usage
How can I use $this->renderView inside a Symfony helper class (not inside a controller)?
I'm new about the function renderView but what do I have to setup to use it within the Helper class?
0
votes
1
answer
146
views
Symfony3.4: Exception occurred while flushing email queue: Expected response code 220 but got an empty response
Project in symfony 3.4 framework, all functions are ready, but an exception to get errors in the process is not working because swiftmailer is not working
<parameters.yml>
mailer_transport: smtp
...
0
votes
0
answers
25
views
react installation on a page of a symfony 3.4 website
I come to ask for help here for a problem I can't solve. I have a symfony 3.4 website and I wanted to put some react on a page of my website, so I followed the tuto :https://www.twilio.com/blog/...
0
votes
0
answers
24
views
Phpunit doesn't run subprocess
I'm creating some tests but its seems like a subprocess is not executed in the test but it is executed on a normal execution(not testing), there is any problem with phpunit and subprocesses?
this is ...
3
votes
1
answer
93
views
SonataAdminBundle and OneToOne relationship
I have a OneToOne relationship between Page and SuperGridContent:
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="page")
* @...
0
votes
0
answers
245
views
symfony easyadmin customize field value
i have an Entity Product that has a field category.
If i call the list i want to show the name of the Category.
If i call edit i want to show the name and the id of the Category in the Options like ...
0
votes
1
answer
53
views
Unable to get FormFactory to fill array values on `submit`. Wrong form type?
I have created an integration test to debug an actual issue that seems to stem from upgrading from Symfony 3.3 to 3.4. The issue is that all my array fields on the entity (Doctrine ORM annotated as ...
-1
votes
1
answer
176
views
Unable to write a basic TypeTestCase unit test for a Symfony form
I want to test that I convert form data correctly, and so I wrote a unit test based on how the Symfony 3.4 docs instruct me to. It is even marked as the basics, so I did not expect any issues, but I ...
0
votes
1
answer
56
views
In Centos 7, how do you permanently consume messages with rabbitmq?
Good day,
I have just uploaded Symfony 3.4 project (PHP 7.2) to Centos server and my application needs to be connected to RabbitMQ. I want to do that in Centos server rabbitmq is constantly consuming ...
-1
votes
1
answer
97
views
Get base url on symfony 3.4 command
I'm trying to get the base url on a command to get localhost on local and the production url on producction but all the exmaples I found are using the reuqest object but I
don't have it on a command:
...
1
vote
1
answer
36
views
Pluralization on symfomy command
I've created a commmando which needs pluralization to send some emails
//without pluralization works fine
//$body = $this->translator->trans('expiration.password.reminder.body', $email_params, '...
-1
votes
1
answer
174
views
Symfony returning HTTP 304 locally, but HTTP 200 for matching ETag in production
Due to a heavy API call taking upwards of 20 seconds, I have enabled computation of ETag for that resource and pre-compute the ETag before doing any heavy DB work to be able to return early. This ...
1
vote
1
answer
66
views
How to update a form with an EntityType using 'data' option
I have a form to insert and update users, and a country field which is an entityType similar to this (code in the FormType):
$builder
->add('countries', EntityType::class, [
'label' ...
0
votes
0
answers
27
views
Receiving error "Cannot autowire service" in Controller which extends another Controller (Symfony)
I have the controller:
class FormConstructorController extends BaseController
{
/**
* @Route("/form-constructor", name="form_constructor")
* Security("...
2
votes
1
answer
199
views
Unable to get mock container to return anything but null
I have a test that fails due to me being unable to successfully stub the get method of the Controller:
1) Tests\my-project\BackendBundle\Service\PdfGenerateServiceTest::...
-1
votes
1
answer
73
views
Remove % on symfony translated text
I'm translating some texts on symfony this way
expired.password.body: 'Dear %name% %surname%,<br><br>Your password has expired.'
and this is the translation code
$email_params = [
...
1
vote
1
answer
167
views
Raw query on repository class using Symfony 3.4
I need to create a raw query in the repository class, but i'm geting and error
class UserRepository extends EntityRepository
{
public function usertoExpirate(){
$query = 'SELECT email
...
1
vote
1
answer
110
views
Reliable HTTPClient For Symfony 3.4
I've spent a few hours looking for a reliable httpClient for my Symfony3.4 (php 7.2) project. I need to get data from an external API endpoint. I tried:
symfony/http-client (didn't work since it's ...
-2
votes
1
answer
73
views
Convert .pdf string returned from Snappy PDF Generator to .pdf on server to password protect
Our snappy pdf service in our Symfony 3.4 app returns a pdf as a string like so:
%PDF-1.4
%âã
1 0 obj
<<
/Title ()
/Creator (??wkhtmltopdf 0.12.5)
/Producer (??Qt 5.11.3)
/CreationDate (D:...
-1
votes
1
answer
109
views
How to achieve an authentication level that allows me to pass "Full authentication is required to access this resource"
I am trying to debug a Resque setup in an (inherited) app, and so I found that there is a route for resque at /hidden/resque that would be nifty to access, but I am unable to access the route. I am ...
0
votes
0
answers
33
views
Symfony 3.4 Socials Login
What is the best way to create Microsoft, Apple, Google login to my Symfony 3 App?
I have tried hwui Bundle and test it with github login, seems easy, but result an error
0
votes
0
answers
169
views
Symfony 3.4 apply tag on all classes who implement same interface
I'm working with a Symfony 3.4 (PHP 7.2, update to 7.4 soon) project. I have some classes who extends an abstract class and i would like all my classes got the same constant name (constant have value ...
-1
votes
1
answer
171
views
Set request content to test in symfony
I have to set a test to check the user registragion with an API , but I'm not sure how to set the content, its has to had a header with the token named x-auth-tokenand the body with aform-data` param ...
-1
votes
2
answers
35
views
Send responseon EventSubscriber Symfony 3.4
I'm trying to set a response on an eventsubscriber that checks if an API authorization token it's correct
class TokenSubscriber implements EventSubscriberInterface
{
private $em;
public ...
1
vote
2
answers
135
views
Adding debug traces to Symfony 3.4 twig templates during/after render
I am looking for a seamless way to do this.
With Symfony 3.4, I need a way to, having a rendered page, know, for any element/text, which twig template it comes from.
NOTE: I have checked Twig - ...
0
votes
1
answer
38
views
formbuilder choose to not show a field in symfony
I'm building a questionnaire that is shown in two templates but I need to not show some filed in one of the templates
$builder
->add('acceptConsent', CheckboxType::class, [
...
-3
votes
1
answer
114
views
Doctrine - Is it possible to associate a column result with an other column result instead of her column name
Sorry for this unclear question.
I don't know how to explain what I want in words without sample code so for the first time I couldn't find a solution on the web and I'm here.
I am working on a ...
0
votes
0
answers
45
views
Symfony - Customize Voter's "access denied"
I wanna know if there a way to customize the red page "Access Denied" provided by a Voter?
I want to redirect to another page which explained why the access is denied in a friendly way, it ...
0
votes
0
answers
92
views
Symfony and Postgres - connection with non public schema
I have a problem configuring symfony 3.4 with postgres. Exactly when the main scheme is not public.
Symfony works and connects to the database without errors, but that's it. Application does not, ...
0
votes
0
answers
112
views
Cannot inject EntityManagerInterface to use doctrine inside a service on symfony3.4
I added the EntityManagerInterface to use doctrine inside the service
namespace AppBundle\Service;
class UploadFileService
{
private $upload_directory;
private $is_api;
private $em;
...
0
votes
0
answers
34
views
Generate radio buttons on NM relation using form builder on symfony formbuider
When I add this field this way
->add('options', EntityType::class, [
'class' => Disease::class,
'query_builder' => function (EntityRepository $er) use ($...
0
votes
1
answer
171
views
Authenticate anonymously with roles
I have an Authenticator that needs to authenticate the user anonymously, but include a role. I do this by overriding createAuthenticatedToken in the Authenticator:
class ClientAuthenticator extends ...
0
votes
0
answers
155
views
Symfony FormLoginAuthenticator doesn't log user in
I am refactoring the authentication system for a Symfony application as I the upgrade the application from Symfony 3.3 to 3.4.
We use a login form, authenticated with a AbstractFormLoginAuthenticator. ...
-1
votes
2
answers
113
views
Symfony: Use a value within a parameter array as a service parameter
Symfony 3.4
I have a parameter that looks like this:
parameters.yml:
paramters:
some_configuration:
param1: value1
param2: value2
I want to pass a value within my ...
0
votes
2
answers
59
views
Concat translated key on twing using symfony 3.4
I'm trying to gererate the translation key that has to be translated and show at the template but is not working
<h2 class="text-withe">{{ 'cover.title.'~product.id | trans | raw }}&...
0
votes
0
answers
312
views
How to get Twig template engine service in a test class with Symfony 3.4? [duplicate]
I am writing a test for a class that renders a template. I don't want to make a functional test as the template is rendered and returned in a variable.
Here's the method I want to test (this class ...
0
votes
0
answers
94
views
Symfony 3.4 form dropdown required but empty to start
I have created a form which populates a dropdown field with objects.
I would like the dropdown field to be required BUT also empty (or showing a placeholder) when users first get to the page (so as to ...
-1
votes
1
answer
83
views
Symfony - Optimize form with repetitive EntityType
The current website I'm developing right now is running Symfony 3.4.
One of my entities is Contact:
I get a very large MySQL table with ~ 14.000 rows of contact profile :
Name
Email
Phone number
...
0
votes
0
answers
189
views
Return response in EventSubscriber in symfony 3.4
I have this eventsubscriber but I need to return a json response instead thow an exception when the api key validation fails
class AuthSubscriber implements EventSubscriberInterface
{
private $...
-1
votes
1
answer
607
views
Symfony 3.4 NotFoundHttpException No route found for "GET /lucky/number"
I'v created a symfony 3.4 project,and I've create a controller following the doc (I had to change the controller namespace)
<?php
namespace App\Controller;
//namespace AppBundle\Controller; this ...