918 questions
0
votes
0
answers
62
views
how to work with multiples databases in differents servers api platform
I am quite new with Simfony and
I'm having trouble configuring api platform to search a specific database when accessing an endpoint.
I tested that the connections with the db are working with the ...
2
votes
1
answer
189
views
Symfony 3.4 Assert optional validation callback not working
I have put a callback inside Assert\Optional but it is not being called when I put outside the Optional It does get called but I get field missed error in case that option parameter is not in request. ...
0
votes
0
answers
88
views
Symfony 3.4 AuthorizationChecker not available
I am dealing with some old symfony code, and I have a bundle that needs AuthorizationCheckerInterface. I can see that symfony/security-core is installed but if I check the container I don't see the ...
0
votes
1
answer
245
views
How can I set the Policy parameter in the authorization URL with knpuniversity/oauth2-client-bundle?
I am using
Symfony 3.4
and knpuniversity/oauth2-client-bundle (v1.34.0)
with the client library thenetworg/oauth2-azure (v1.4.2) to connect to an Azure AD B2C App.
When I initiate an authorization ...
0
votes
1
answer
101
views
Symfony advice : where to place code about an entity that needs complex database queries?
I need an advice for my Symfony 3.4 project (yes I know there is Symfony 6), I have an entity Product and I created a method that calculates the completion percentage of a Product sheet. It checks ...
0
votes
0
answers
16
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/...
1
vote
2
answers
3k
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
363
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
93
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
1k
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
1
answer
220
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 ...
0
votes
1
answer
160
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
833
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 ...
3
votes
1
answer
665
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
vote
1
answer
600
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
...
-2
votes
1
answer
231
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:...
0
votes
0
answers
887
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
2
answers
82
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 ...
0
votes
1
answer
126
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, [
...
0
votes
0
answers
344
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
1
answer
617
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
2
answers
174
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 }}&...
-1
votes
1
answer
299
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
...
-2
votes
1
answer
344
views
symfony 3.4 installer downloads an html file
I tried to install symfony 3.4 on ubuntu 21.04 following the doc
sudo mkdir -p /usr/local/bin
sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/...
1
vote
0
answers
407
views
Symfony 3.4 controller is not autowired correctly
I have a symfony 3.4 projet with multiple application bundles.
I added autowiring configuration in app/config/services.yml as follow :
services:
_defaults:
# automatically injects dependencies ...