Re: [symfony-users] Re : missing first data in data list

2011-06-20 Thread Vincent Lechemin
it's a problem of encoding, make sure your database settings use utf8, and use utf8_encode/decode to display or write back into the database -- Vincent On Jun 20, 2011 1:35 PM, Jérémy Simonklein jeremy.simonkl...@gmail.com wrote: Sorry, I've founded the solution. It came from the accents on my

[symfony-users] [sf2] Another folder for entities

2011-06-07 Thread Vincent Lechemin
Hello, I'd like to make an entity class only for unit testing, on IRC i was suggested to use the dir attribute in the config, but it only finds the entity if i have the default namespace: Me\MyBundle\Entity. But if i use this namespace, autoloading does not work, anyone has a solution? Thanks,

Re: [symfony-users] Months in date field not always in same format

2011-06-05 Thread Vincent Lechemin
Maybe it's because he has the intl extension enabled and you don't. -- Vincent -- 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

Re: [symfony-users] [SF2] Question on security password encoding

2011-05-30 Thread Vincent Lechemin
Hi, you could use doctrine events such as preUpdate and prePersist. Then adding the encoder service in the constructor could be a way to enforce the encryption. For the fixtures, you have access to the container so it should not be a problem. -- Vincent -- If you want to report a vulnerability

Re: [symfony-users] [SF2] Question on security password encoding

2011-05-30 Thread Vincent Lechemin
Ops, the forced parameter in the constructor is not a good idea for an entity :p -- Vincent On May 30, 2011 9:29 AM, Vincent Lechemin vincent.leche...@gmail.com wrote: Hi, you could use doctrine events such as preUpdate and prePersist. Then adding the encoder service in the constructor could

Re: [symfony-users] doctrine2 numRows

2011-05-16 Thread Vincent Lechemin
Just use the php function count on the results, it is O(1). -- Vincent -- 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

Re: [symfony-users] AuthenticationEntryPoint questions

2011-05-13 Thread Vincent Lechemin
I'm not sure if it is the right way either, but my way to do this is to define a custom path for 403 errors, security: access_denied_url: /error/403 and then use the custom controller to handle the wanted behavior. -- Vincent -- If you want to report a vulnerability issue on symfony,

Re: [symfony-users] [Symfony2] Highlighting menu based on controller called

2011-05-12 Thread Vincent Lechemin
I am using the route name to do that and it works most if the time, except when there is an internal redirection. It is better than the path because it is not parameter dependant. But I'm still looking for a better way. -- Vincent -- If you want to report a vulnerability issue on symfony,

Re: [symfony-users] [FORM] Multitple Entity type

2011-05-11 Thread Vincent Lechemin
yes I did :( -- Vincent -- 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] [FORM] Multitple Entity type

2011-05-10 Thread Vincent Lechemin
Hi, I'm trying to use the entity type with a OneToMany relationship, but it's not working. Is there anything special to do? Thanks, -- Vincent -- 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

Re: [symfony-users] [Symfony2]: Twig: How to access array value by decimal key?

2011-05-10 Thread Vincent Lechemin
Try the array access, test.foo[0] -- Vincent -- 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

Re: [symfony-users] Re: Symfony2 forms : can I show/hide fields

2011-05-05 Thread Vincent Lechemin
On Thu, May 5, 2011 at 9:41 AM, Manu emmanuel.parf...@gmail.com wrote: How does Symfony2 handle inheritance ? This also interests me, what's the best way to make a form with inheritance having multiple possibilities for data_class? -- Vincent -- If you want to report a vulnerability issue on

Re: [symfony-users] [AsseticBundle][Compass] Compile for production?

2011-05-05 Thread Vincent Lechemin
On Wed, May 4, 2011 at 2:41 PM, Daniel Gomes daniel.go...@reset.pt wrote: I'm using compass in the AsseticBundle for the CSS's. My question is, in development it creates a temporary css file but in production it doesn't? Is there other configuration that i need to do? Thanks, Try this:

Re: [symfony-users] Re: Symfony2 forms : can I show/hide fields

2011-05-05 Thread Vincent Lechemin
for now I'm doing that too, multiple forms with different actions and javascript to hide, but I was wondering if there was another solution -- Vincent -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message

Re: [symfony-users] Forms - ChoiceType empty_value + required?

2011-05-05 Thread Vincent Lechemin
to do that I redefined the template of the choice list -- Vincent -- 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,

[symfony-users] Re: Switching roles with moderation

2011-04-28 Thread Vincent Lechemin
Hi, I resolved my problem by adding in attemptSwitchUser line 128 (after the target user ($user) is fetched): if (false === $this-accessDecisionManager-decide($token, $user-getRoles())) { throw new AccessDeniedException(); } But i did not find any other way to add this test to the framework

[symfony-users] Re: Switching roles with moderation

2011-04-28 Thread Vincent Lechemin
I found a solution, maybe it could help someone. It is possible to do that by implementing your own event listener as a service on the event onSecuritySwitchUser. You also need to add the services security.context and security.access.decision_manager as arguments to your service. -- Vincent --

Re: [symfony-users] New form system questions

2011-04-27 Thread Vincent Lechemin
And also, how can I replace the previous preprocessData? -- Vincent -- 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

Re: [symfony-users] New form system questions

2011-04-27 Thread Vincent Lechemin
I looked into the code and I found: $builder-addEventListener(Events::onBindClientData, function (FilterDataEvent $event) { ... }); Maybe it could help someone :) -- Vincent -- If you want to report a vulnerability issue on symfony, please send it to security at

[symfony-users] Switching roles with moderation

2011-04-27 Thread Vincent Lechemin
Hello, I'd like to use 'ROLE_ALLOWED_TO_SWITCH' for someone else than the super admin. But once a user has this role, he can switch to any role, even the super admin. Even with the following configuration: security: access_decision_manager: strategy: unanimous Is there a way to limit

Re: [symfony-users] New form system questions

2011-04-27 Thread Vincent Lechemin
On Tue, Apr 26, 2011 at 4:00 PM, Vincent Lechemin vincent.leche...@gmail.com wrote: 'data' = array('value1' = true, 'value2' = true) After checking ArrayToBooleanChoicesTransformer, the right way to do it was: 'data' = array('value1', 'value2') -- Vincent -- If you want to report

[symfony-users] New form system questions

2011-04-26 Thread Vincent Lechemin
Hi, While updating to the new system, I got some problems. In twig, how can I test if a field has an error? Is there a replacement to the data option with choice field type? It allowed to preset data. Thanks, -- Vincent -- If you want to report a vulnerability issue on symfony, please send

[symfony-users] Re: New form system questions

2011-04-26 Thread Vincent Lechemin
On Tue, Apr 26, 2011 at 3:26 PM, Vincent Lechemin vincent.leche...@gmail.com wrote: Is there a replacement to the data option with choice field type? It allowed to preset data. Correction, the data option does exist, but it is not shown in the template? -- Vincent Lechemin -- If you want

Re: [symfony-users] New form system questions

2011-04-26 Thread Vincent Lechemin
{% if form.field.errors|length 0 %} When I do that, I get Method errors for object Symfony\Component\Form\FormView does not exist. You have to set the correct data in your *object* which is used to populate the form. $object-setProperty('default'); or private $property = 'default'; I'm

Re: [symfony-users] New form system questions

2011-04-26 Thread Vincent Lechemin
On Tue, Apr 26, 2011 at 4:22 PM, Bernhard Schussek bschus...@gmail.com wrote: How do you plan to validate your form then? Usually this is done using the validation constraints in the underlying object. If you want to work on plain arrays, this is possible but not documented yet and slightly

Re: [symfony-users] Symfony2 extends twig - creating a new filter

2011-04-22 Thread Vincent Lechemin
On Thu, Apr 21, 2011 at 3:41 PM, melopoeia epereira...@gmail.com wrote:            'my_filter'   = new \Twig_Filter_Function('twig_my_new_filter'), Try this instead: 'my_filter' = new \Twig_Filter_Method($this, 'my_filter'), -- Vincent Lechemin -- If you want to report a vulnerability

Re: AW: [symfony-users] doctrine:generate:entities duplicates entity file

2011-03-29 Thread Vincent Lechemin
Do you have getters setters for your class? -- Vincent Lechemin -- 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

Re: [symfony-users] Symfony2 authentication with User Entity

2011-03-24 Thread Vincent Lechemin
Hi, On Wed, Mar 23, 2011 at 4:34 PM, Sergi sergi.arger...@gmail.com wrote:    public function getSalt()    {        return $this-getId();    } Did you encrypt your password with this salt? -- Vincent -- If you want to report a vulnerability issue on symfony, please send it to security

Re: [symfony-users] Security + Entity + Fixtures + Encoding How do I encode in fixture

2011-03-24 Thread Vincent Lechemin
You can access it by implementing the interface ContainerAwareInterface -- Vincent Lechemin On Mar 24, 2011 12:29 PM, badllama77 badllam...@gmail.com wrote: Ok so the scenario is pretty simple, I want to create some dummy users using fixtures, I need to encode their passwords. How do I get

Re: [symfony-users] Re: Question about sfFormObject::saveEmbeddedForms()

2011-03-19 Thread Vincent Lechemin
-- Vincent Lechemin On Mar 19, 2011 5:44 AM, Richtermeister nex...@gmail.com wrote: I think the silence is your answer.. we're all suffering from this, and I believe the SF2 form system won't have this issue any more. Daniel On Mar 15, 8:47 pm, bkuberek bkube...@gmail.com wrote: symfony

Re: [symfony-users] Production environment

2011-03-11 Thread Vincent Lechemin
Did you enable mod_rewrite? Or just check php_error.log -- Vincent Lechemin -- 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