[symfony-users] Set RequestFormat according to HTTP-header

2011-04-20 Thread winzou
I'm trying to set up a pajax organisation within my sf2 project. The aim is : if request has a P-AJAX header, then set RequestFormat to htmlRaw (for instance), but _before_ the route matching. I mean, I want to define in my routes if the htmlRaw format is allowed or not. So if the P-AJAX header

[symfony-users] [sf2] Access to current route

2011-04-26 Thread winzou
Hi all, I didn't manage to find an easy way to retrieve the current matched route. I'm from an onCoreController listener, but the question is for everywhere else. The only way I found is that one : $this-router-getRouteCollection()-get($event-getRequest()-attributes-get('_route')) So I pass

Re : Re: [symfony-users] [sf2] Access to current route

2011-04-26 Thread winzou
My aim is to change the RequestFormat if there is a P-JAX header defined, but only if the route requirement of _format (or _method or whatever) allows it. In other words, I want the route config file to decide if I can render a different template for my action ( via

Re : Re: Re : Re: [symfony-users] [sf2] Access to current route

2011-04-27 Thread winzou
Unfortunatly there isn't the requirements parameter of the route in the request attributes. That's why I'm only fetching the name of the route from the request attributes, and then use it to retrieve the Route from the RouteCollection, to finaly reach the requirements via

Re : Re: Re : Re: Re : Re: [symfony-users] [sf2] Access to current route

2011-04-27 Thread winzou
Hence my question ! So I understand that it's not possible to do what I want ? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to

[symfony-users] [sf2] Beta1 Fatal Error after updated

2011-04-30 Thread winzou
Hi there, I've updated sf2 from PR10 to beta1, and got this error : *Catchable fatal error*: Argument 1 passed to appdevUrlMatcher::__construct() must be an instance of Symfony\Component\Routing\RequestContext, array given, called in

[symfony-users] [sf2] Beta1 Fatal Error after updated

2011-04-30 Thread winzou
Hi there, I've updated sf2 from PR10 to beta1, and got this error : *Catchable fatal error*: Argument 1 passed to appdevUrlMatcher::__construct() must be an instance of Symfony\Component\Routing\RequestContext, array given, called in

[symfony-users] Re: Symfony2 ACL Performance Question

2011-05-02 Thread winzou
Any news from both of you? I'm very interested as well. What's the best practice here? On 16 avr, 06:45, Tim Nagel t...@nagel.com.au wrote: Normally we'll expect the developer to implement their own controllers/views if they need anything more advanced than what we're providing at the moment,

[symfony-users] [sf2] Creating ACL - Best practice ?

2011-05-02 Thread winzou
Hi, I'm setting up a real secure area, with secured domain objets. Thanks to the doc, here is the process of granting owner access : if ($form-isValid()) { $entityManager = $this-container- get('doctrine.orm.default_entity_manager'); $entityManager-persist($comment);

[symfony-users] Re : Re: Symfony 2 and MSSQL

2011-05-04 Thread winzou
You need to retrieve the specific driver from Microsoft, check this out : http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received

Re : Re: [symfony-users] [sf2] Creating ACL - Best practice ?

2011-05-04 Thread winzou
I've seen your solution, and I like it. But as this is a very common issue, I thought a better integrated solution would emerge. I didn't know that ACL doesn't use the ORM... Quite a problematic issue. (btw merk, is there any simple way for turning off trees in your bundle, and just have

[symfony-users] [sf2] Doctrine2 cache with Symfony2

2011-05-05 Thread winzou
Hi, Doctrine2 has a cache system. But does Symfony2 use it? I'm using FOS\UserBundle and on the page /user/{username}, if I'm logged into test user and want to see /user/test, then 2 requests are executed. And these two requests are exactly the same, namely something like

[symfony-users] Re : Re: Doctrine2 cache with Symfony2

2011-05-05 Thread winzou
I'm using array caching for the moment. Shouldn't it work even with the array driver for the cache? As it's in the same http request, array caching must persist data from the first SQL request until the second one. But it doesn't. -- If you want to report a vulnerability issue on symfony,

[symfony-users] Re: Different Error 500 pages for different languages

2011-05-08 Thread winzou
You can still use translation in your template. cf http://symfony.com/doc/current/book/translation.html#translations-in-templates -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed

[symfony-users] Re: [Routing] Add the _locale in the prefix for included routes

2011-05-10 Thread winzou
I'm interested as well in this issue. Is it / Will it be possible to add core parameters in the prefix when importing bundle's routing file? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are

[symfony-users] Re: [Assetic] Error: Unable to launch a new process

2011-05-12 Thread winzou
Wait for this PR https://github.com/kriswallsmith/assetic/pull/40/files to be merged, or modify your local code yourself according to it. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are

Re: [symfony-users] [Symfony2] Routing - Problem with the _locale default value

2011-05-12 Thread winzou
The master branch means the symfony/symfony master branch : https://github.com/symfony/symfony -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users

[symfony-users] Re : Re: Form : check if it is a new record

2011-05-13 Thread winzou
Depends on your application, but usually you should be able to use the assertion `null !== $entity-getId()` -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups

[symfony-users] [sf2] Service parameters definition

2011-05-14 Thread winzou
Hi there, I'm stuck on a parameter issue. I defined a service in a services.yml: services: winzou_book.entry_manager: class: %winzou_book.entry.manager.class% arguments: [@doctrine.orm.entity_manager, %winzou_book.entry.entity.class%] If a put a parameters section on top

[symfony-users] Re : [sf2] Service parameters definition

2011-05-16 Thread winzou
For people interested in the solution. Actually the $processor-process() doesn't register any parameter. It just parses the content of $configs, which is the content of app/config/config.yml. So you have to manually (??) register each parameter into the container. This can be done thanks to

[symfony-users] [sf2] Validating - equivalent of sfValidatorDoctrineUnique ?

2011-05-26 Thread winzou
I was looking for an equivalent of sfValidatorDoctrineUnique, but it seems it doesnt exist yet. Actually it should be quite easy because validation constraints are defined directly on the Entity. That's why I would be surprised if it really doesnt exist. Please let me know. Thanks -- If you

Re: [symfony-users] [sf2] Validating - equivalent of sfValidatorDoctrineUnique ?

2011-05-26 Thread winzou
Amazing thanks! I will test it because this code : * $result = $repository-findBy($criteria); if (count($result) 0 $result[0] !== $entity) seems weird to me. What if $entity-email is not modified since its db retrieval, but $entity-age is? The $result[0] entity still has the old value for

[symfony-users] Re: Is there demand for a Symfony2 Eclipse Plugin?

2011-06-01 Thread winzou
Hi, As a user of ZendStudio, I'm very interested in a sf2/twig/yaml plugin. Thanks a lot for your contribution -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google

[symfony-users] [sf2] Handling AccessDeniedException

2011-06-02 Thread winzou
Hi all, I'm using some ajax features with Symfony2 and jQuery. All is working well, except the case when an ajax request encounters an AccessDeniedException. The behavior in the usual case is to redirect to the login page, I'm ok with that. But, when it's an XmlHttpRequest, with a Json

[symfony-users] Re: Handling AccessDeniedException

2011-06-02 Thread winzou
Thank you for your answer, but it's not the point. You're right, in theory, an AJAX request should not face an AccessDeniedException. But I'm just playing with the framework, and wanted to see the behavior in case of. So I throw my AccessDeniedException on purpose, for me to make a javascript

[symfony-users] Re: Handling AccessDeniedException

2011-06-06 Thread winzou
Hi, I'm still stuck on this. Any idea? Thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to

[symfony-users] Re: [S2-Doctrine2] Get custom set of associated objects in lazy loading, not all related object (how to implement a filter ).

2011-06-06 Thread winzou
You have to create a method in your objectA entity, like findPublicObjectB(), which returns only the objectB you want. And then from the template : for objectB in objectA.findPublicObjectB. -- If you want to report a vulnerability issue on symfony, please send it to security at

Re: [symfony-users] Re: [S2-Doctrine2] Get custom set of associated objects in lazy loading, not all related object (how to implement a filter ).

2011-06-06 Thread winzou
Sorry I meant from the entity repository of course ! Like $listObjectsB = $ObjectARepository-findPublicObjectB($objectA) And in the findPublicObjectB() method, you make a DQL or whatever request to retrieve only the objectsB you want. -- If you want to report a vulnerability issue on symfony,

Re: [symfony-users] Re: [S2-Doctrine2] Get custom set of associated objects in lazy loading, not all related object (how to implement a filter ).

2011-06-07 Thread winzou
It doesn't change so much the solution. Implement a findAllWithPublic() method in the ObjectA repository. This method selects objects A, makes the join on objects B with the appropriate condition (the is_public_content = true), and returns all that. Then you can do your for without any problem.

Re: [symfony-users] Re: [S2-Doctrine2] Get custom set of associated objects in lazy loading, not all related object (how to implement a filter ).

2011-06-07 Thread winzou
Ok, you're stuck on an pure SQL issue. Check this query: SELECT a, b FROM objectA a LEFT JOIN objectB b ON (objectB.id_a = objectA.id AND objectB.is_public_content = true) The trick is to put the condition in the ON, not in the WHERE. -- If you want to report a vulnerability issue on symfony,

[symfony-users] Re: not a valid document or mapped super class

2011-06-08 Thread winzou
Hi, Please give us the source of your Article document. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email

[symfony-users] Re: Protecting AJAX action from CSRF attack

2011-06-08 Thread winzou
I'm very interested as well in this issue. Thanks. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to

[symfony-users] [sf2] [FOSUserBundle] How to override the user_provider

2011-06-09 Thread winzou
Hi all, I want to override the user_manager service in order to modify the findByUsername() method (to add a JOIN when loading users from the user_provider). I've added my own Entity\UserManager in the directory of my bundle which inherits from FOSUserBundle, but it doesn't work. First

Re: [symfony-users] Re: [sf2] [FOSUserBundle] How to override the user_provider

2011-06-16 Thread winzou
I extend the UserManager (which implements UserProviderInterface) because I don't want to write a new one from scratch, as it perfectly fits my needs. I may have been not so clear: my point is to use the UserManager of FOS, but with just a little modification of the findUserByUsername() method.