Questions tagged [symfony-2.1]

This is the Symfony 2.1.x specific tag. Use it in addition to the symfony2 tag if your question is specific to Symfony 2.1.x — not just 2.x.

Symfony is a PHP full-stack web framework developed and maintained by Sensio Labs.

As of May 2013, 2.1 is deprecated in favor of the newer versions.

Information

This tag is specific for the 2.1 version of Symfony, which has been released on the 6 September 2012. See the tag for general Symfony 2.x questions.

Symfony 2.1 code is hosted and versioned on github.

As of 2 June 2013, the latest stable release of Symfony 2.1 is version 2.1.11.

Useful links

1094 questions
23
votes
6 answers

How to get container instance in sonata Admin class?

I need to parse some configurations parameters from my config.yml such as enabled languages. But when i try to do that by using the normal symfony method: $this->container->get('my_params'); it fails because my admin class extends…
skonsoft
  • 1,786
  • 5
  • 22
  • 43
22
votes
2 answers

Doctrine query building select MAX

I would like to select everything + MAX value and receive only rows having max values. $query = $this->createQueryBuilder('s'); $query->where('s.challenge = :challenge')->setParameter('challenge', $challenge); …
rat4m3n
  • 1,201
  • 2
  • 16
  • 23
22
votes
3 answers

No encoder has been configured for account with fosUserBundle symfony2.1

I have this error when I submit the connexion form (I use FOSUserBundle latest version) : No encoder has been configured for account "MyApp\UtilisateurBundle\Entity\Utilisateur here is my entity :
user201892
  • 277
  • 2
  • 4
  • 11
21
votes
8 answers

When are user roles refreshed and how to force it?

First off, I'm not using FOSUserBundle and I can't because I'm porting a legacy system which has its own Model layer (no Doctrine/Mongo/whatsoever here) and other very custom behavior. I'm trying to connect my legacy role system with Symfony's so I…
netmikey
  • 2,422
  • 2
  • 28
  • 35
19
votes
1 answer

how to generate entities and schemas for enum in symfony

i am trying to generate entities for my contact information. for that i have first create Entity with the following syntax used where i have created one enum field. php app/console doctrine:generate:entity --entity="BannerTestBundle.contact"…
Viraj.S
  • 305
  • 1
  • 8
  • 18
19
votes
5 answers

Validating dynamically loaded choices in Symfony 2

I have a choice field type named *sub_choice* in my form whose choices will be dynamically loaded through AJAX depending on the selected value of the parent choice field, named *parent_choice*. Loading the choices works perfectly but I'm…
Chris
  • 223
  • 1
  • 3
  • 7
19
votes
3 answers

MySQL Illegal mix of collations

After viewing my prod logs, I have some error mentionning : [2012-08-31 15:56:43] request.CRITICAL: Doctrine\DBAL\DBALException: An exception occurred while executing 'SELECT t0.username ....... FROM fos_user t0 WHERE t0.username = ?' with params…
sf_tristanb
  • 8,725
  • 17
  • 74
  • 118
19
votes
3 answers

Symfony2 is_granted('IS_AUTHENTICATED_FULLY') during 404 error page display, causing ResourceNotFoundException

I have setup custom error pages to display for certain HTTP errors in the folder: app/Resources/TwigBundle/views/Exception/ The 403 page (error403.html.twig) works and displays as expected. The 500 page (error500.html.twig) works and displays as…
Nick
  • 1,180
  • 1
  • 10
  • 15
19
votes
5 answers

Authentication in functional tests in Symfony 2.1

I am currently in the process of migrating a 2.0.* project to the current 2.1 beta of Symfony. In my functional tests i currently have this code to create a client with authentication: $client = // create a normal test client $role =…
smoove
  • 3,920
  • 3
  • 25
  • 31
18
votes
3 answers

How to retrieve a streamed response (e.g. download a file) with Symfony test client

I am writing functional tests with Symfony2. I have a controller that calls a getImage() function which streams an image file as follows: public function getImage($filePath) $response = new StreamedResponse(); …
Lorenzo Polidori
  • 10,332
  • 10
  • 51
  • 60
18
votes
3 answers

Symfony 2 | Form exception when modifying an object that has a file(picture) field

I'm using Symfony2. I have an entity Post that has a title and a picture field. My problem : Everything is fine when I create a post, I have my picture etc. But when I want to modify it, I have a problem with the "picture" field which is an…
Reveclair
  • 2,399
  • 7
  • 37
  • 59
17
votes
5 answers

CORS Api with symfony

I should make cross domain API with Symfony. There is some bundle for that? I have tried FOS Rest Bundle but did not seem have solved my problem.
Daniele Dolci
  • 884
  • 1
  • 9
  • 22
17
votes
4 answers

Listener "SoftDeleteableListener" was not added to the EventManager

I followed the this example to test softdeletable extension on my project running Symfony 2.1.0-DEV. I configured my config.yml like below: orm: auto_generate_proxy_classes: %kernel.debug% auto_mapping: true filters: …
Ricky Li
  • 191
  • 1
  • 1
  • 6
16
votes
6 answers

Deploying Symfony2 Application to AWS Elastic Beanstalk - Post Deployment Cache Clearing

When deploying a Symfony2 app to Elastic Beanstalk I need to perform a manual cache clear in order for the app to begin functioning. So, I added a container command to clear the prod cache during deployment. The command runs, but I still had to…
16
votes
4 answers

How would you add a file upload to a Symfony2 DataFixture?

I can't seem to wrap my head around how I would go about adding a file upload to a DataFixture. I'm trying to upload an image for the dummy content my fixtures load. This seems like something that would be useful to know.
ornj
  • 720
  • 7
  • 16
1
2
3
72 73