Re: [symfony-users] sfWidgetFormPropelChoice newbie problem help needed please

2011-02-15 Thread Gareth McCumskey
Technically you are not supposed to add your won code to symfony's
auto-generated Base classes. Ideally you should be creating your own form
class that extends that Base class and then setting your configuration in
there. The simple reason is that if you altered schema and rebuilt the forms
all your changes would essentially be wiped out.

On Mon, Feb 14, 2011 at 3:12 PM, Helloise Smit
wrote:

> i have the following code:
>
> abstract class BaseLpmServiceForm extends BaseFormPropel
> {
>  public function setup()
>  {
>$this->setWidgets(array(
>  'id'   => new sfWidgetFormInputHidden(),
>  'name' => new sfWidgetFormInputText(),
>  'wap_home' => new sfWidgetFormInputText(),
>  'call_center_number'   => new sfWidgetFormInputText(),
>  'catcher_id'   => new
> sfWidgetFormPropelChoice(array('model' => 'LpmCatcher', 'add_empty' =>
> false)),
>  'price_description'=> new sfWidgetFormInputText(),
>  'logo' => new sfWidgetFormInputText(),
>  'invalid_msisdn_text'  => new sfWidgetFormInputText(),
>  'terms_and_conditions' => new sfWidgetFormInputText(),
>  'service_code' => new sfWidgetFormInputText(),
>));
>
>$this->setValidators(array(
>  'id'   => new sfValidatorChoice(array('choices'
> => array($this->getObject()->getId()), 'empty_value' => $this-
> >getObject()->getId(), 'required' => false)),
>  'name' => new
> sfValidatorString(array('max_length' => 64, 'required' => false)),
>  'wap_home' => new
> sfValidatorString(array('max_length' => 256, 'required' => false)),
>  'call_center_number'   => new
> sfValidatorString(array('max_length' => 13, 'required' => false)),
>  'catcher_id'   => new
> sfValidatorPropelChoice(array('model' => 'LpmCatcher', 'column' =>
> 'id')),
>  'price_description'=> new
> sfValidatorString(array('max_length' => 128, 'required' => false)),
>  'logo' => new
> sfValidatorString(array('max_length' => 255, 'required' => false)),
>  'invalid_msisdn_text'  => new
> sfValidatorString(array('max_length' => 255, 'required' => false)),
>  'terms_and_conditions' => new
> sfValidatorString(array('max_length' => 750, 'required' => false)),
>  'service_code' => new
> sfValidatorString(array('max_length' => 3, 'required' => false)),
>));
>
>$this->widgetSchema->setNameFormat('lpm_service[%s]');
>$this->errorSchema = new sfValidatorErrorSchema($this-
> >validatorSchema);
>parent::setup();
>  }
>
>  public function getModelName()
>  {
>return 'LpmService';
>  }
> }
>
> then i have in _form.php the following snippet:
> renderLabel();
>  $catcher_id = $form->getObject()->getCatcherId();
>  $catcher = LpmCatcherPeer::getByCatcherId($catcher_id);
>  $catcher_name = $catcher->getName();
>?>
>
>  renderError();
>  ?>
>   
>onchange="refreshPage(this.form.services)" id="droplist">
>   
>  //echo $form['catcher_id'];
>  //echo var_dump($_GET($form['catcher_id']));
>  //echo var_dump($_POST($form['catcher_id']));
>  //$catcher_names =  explode(" ",$form['catcher_id']);
>
>  $catcher_names = LpmCatcherPeer::getByAllNames();
>  foreach($catcher_names as $row)
>  {
>  ?>
> php
>  if($row->getName() == $catcher_name) echo
> 'selected="selected"';?>>getName();?>
>  }
>   ?>
>
>
>  //$catcher_names =  explode(" ",$form['catcher_id']);
>  //$user = "";
>  //$message = 'refreshPage("'.$user.'")';
>  //echo $message;
>  $form['service_code']->getWidget()-
> >setAttribute('disabled', 'true');
>  echo $form['service_code']->renderLabel();
>  echo $form['service_code']->renderError();
>  echo $form['service_code'];
>
>  $service_code = $form['service_code']->getValue();
>  if ($service_code != null)
>  {
>  $catcher = LpmServicePeer::getByName($form['name']-
> >getValue());
>  $catcher->setCatcherId(11);
>  $catcher->setServiceCode($service_code);
>  $form['catcher_id']->getWidget()-
> >setAttribute('value','"11"');
>
>  $form->save();
>  }
>?>
>
> my problem lies with the line:
>  $form['catcher_id']->getWidget()->setAttribute('value','"11"'); it
> is not working i get an error..
> if a service code was entered i want to set catcher id to the value
> of 11
> error is:
> 500 | Internal Server Error | sfValidatorErrorSchema
> catcher_id [Required.] and also:
>
>  $errorSchema = new sfValidatorErrorSchema($this);
>
>
>/

Re: [symfony-users] Why doesn't sfOutputEscaperArrayDecorator escape keys?

2011-02-15 Thread Gareth McCumskey
Because the key needs to stay exactly as it is because that is considered a
reference to the value, not a value itself. If sfOutputEscaperArrayDecorator
escaped your keys how could you call them with $array['key'] if the key gets
changed?

On Tue, Feb 15, 2011 at 5:23 PM, Basil Hussain <
basil.huss...@experience-engine.co.uk> wrote:

> I was checking the validity of my project's HTML and noticed that some
> things weren't being escaped properly. After investigating, I
> discovered the problems were in certain places where I am outputting
> an array with string keys.
>
> Basically, in my code I am doing this:
>
> // Action
> $this->foo = array('<<' => 'bbb', '1' => 'aaa', '2' => 'bbb', '3' =>
> null, '4' => 'ddd', '>>' => 'ddd');
>
> // Template
>  $v) ?>
> 
> 
>
> The $foo template value, being an array, obviously gets converted to
> an instance of sfOutputEscaperArrayDecorator. But, I discovered that
> sfOutputEscaperArrayDecorator does not apply any escaping to keys, but
> only values! So where, as I am doing, you are iterating over the array
> and want to output both value *and* key, you get broken HTML where
> your keys happen to contain special characters.
>
> Is there any particular reason why sfOutputEscaperArrayDecorator
> doesn't escape keys?
>
> --
> 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@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] sfJqueryReloadedPlugin -> show loading

2011-02-15 Thread Gareth McCumskey
Have your change_zone div contain the spinner image you want but set its
style attribute as style="display:none" and then just toggle its display
during loading. When the content you want inside it loads it will replace
the image.



 'change_zone',
'loading' => "$('#change_zone').toggle()",
'url' => url_for('fotografia_send_contactmail'),
  ))
 ?>







On Tue, Feb 15, 2011 at 6:19 PM, hribo  wrote:

> Hi guys,
> how to achieve to display loader using *jq_submit_to_remote* method?
>
>jq_submit_to_remote('name', 'Odoslať', array(
> 'update'  => 'change_zone',
> *'loading' => "#loading", //???*
> 'url' => url_for('fotografia_send_contactmail'),
>   ))
>  ?>
>
> in my template is already div with id="loading"
>
> thank you
>
> --
> 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@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Fatal error: Class 'BaseForm' not found

2011-02-15 Thread Gareth McCumskey
Did you clear cache?

On Tue, Feb 15, 2011 at 5:38 PM, dietercubano  wrote:

> Hi comunity! My projects now show that:
> Fatal error: Class 'BaseForm' not found in C:\Documents and Settings
> \Desarrollo Web\Mis documentos\NetBeansProjects\reportes\plugins
> \sfGuardPlugin\lib\form\BasesfGuardFormSignin.class.php on line 3
> after installed sfGuardPlugin and change the schema.yml, could be
> something with relations or something? i was trying create
> BaseForm.class.php manually and build the model again but keeping this
> error... this is my schema.yml:
>
> propel:
>  sf_guard_user_profile:
>_attributes:   { phpName: sfGuardUserProfile }
>id:~
>user_id:   { type: integer, foreignTable: sf_guard_user,
> foreignReference: id, required: true, onDelete: cascade }
>first_name:varchar(20)
>last_name: varchar(20)
>created_at:
>updated_at:
>  cliente:
>_attributes:   { phpName: Cliente }
>id_cliente:{ type: varchar(10), required: true,
> primaryKey: true }
>cliente:   varchar(40)
>created_at:
>updated_at:
>  servicio:
>_attributes:   { phpName: Servicio }
>id_serv:{ type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>servicio:   varchar(40)
>created_at:
>updated_at:
>  sf_guard_user_profile_has_servicio:
>sf_guard_user_profile_id: { type: integer, required: true,
> primaryKey: true, foreignTable: sf_guard_user_profile,
> foreignReference: user_id }
>reporte_id: { type: integer, required: true, primaryKey: true,
> foreignTable: servicio, foreignReference: id_serv }
>  cuenta:
>_attributes:   { phpName: Cuenta }
>id_cuenta:  { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>sf_guard_permission_id: { type: INTEGER, required: true,
> foreignTable: sf_guard_permission, foreignReference: id, onDelete:
> RESTRICT, onUpdate: RESTRICT }
>created_at:
>updated_at:
>  sf_guard_user_profile_has_cuenta:
>sf_guard_user_profile_id: { type: integer, required: true,
> primaryKey: true, foreignTable: sf_guard_user_profile,
> foreignReference: user_id }
>cuenta_id: { type: integer, required: true, primaryKey: true,
> foreignTable: cuenta, foreignReference: id_cuenta }
>  cuentaTaller:
>_attributes:   { phpName: CTaller }
>id_cuenta:   { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>created_at:
>updated_at:
>  servicio_has_cuentaTaller:
>servicio_id: { type: integer, required: true, primaryKey: true,
> foreignTable: servicio, foreignReference: id_serv }
>cuenta_id: { type: integer, required: true, primaryKey: true,
> foreignTable: cuentaTaller, foreignReference: id_cuenta }
>  cuentaRedes:
>_attributes:   { phpName: CRedes }
>id_cuenta:   { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>created_at:
>updated_at:
>  servicio_has_cuentaRedes:
>servicio_id: { type: integer, required: true, primaryKey: true,
> foreignTable: servicio, foreignReference: id_serv }
>cuenta_id: { type: integer, required: true, primaryKey: true,
> foreignTable: cuentaRedes, foreignReference: id_cuenta }
>  cuentaConectividad:
>_attributes:   { phpName: CConectividad }
>id_cuenta:   { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>created_at:
>updated_at:
>  servicio_has_cuentaConectividad:
>servicio_id: { type: integer, required: true, primaryKey: true,
> foreignTable: servicio, foreignReference: id_serv }
>cuenta_id: { type: integer, required: true, primaryKey: true,
> foreignTable: cuentaConectividad, foreignReference: id_cuenta }
>  cuentaRodas:
>_attributes:   { phpName: CRodas }
>id_cuenta:   { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>created_at:
>updated_at:
>  servicio_has_cuentaRodas:
>servicio_id: { type: integer, required: true, primaryKey: true,
> foreignTable: servicio, foreignReference: id_serv }
>cuenta_id: { type: integer, required: true, primaryKey: true,
> foreignTable: cuentaRodas, foreignReference: id_cuenta }
>  reporte:
>_attributes:   { phpName: CReporte }
>id_reporte:   { type: integer, required: true,
> primaryKey: true, autoIncrement: true }
>sf_guard_permission_id: { type: INTEGER, required: true,
> foreignTable: sf_guard_permission, foreignReference: id, onDelete:
> RESTRICT, onUpdate: RESTRICT }
>created_at:
>updated_at:
>  sf_guard_user_profile_has_reporte:
>sf_guard_user_profile_id: { type: integer, required: true,
> primaryKey: true, foreignTable: sf_guard_user_profile,
> foreignReference: user_id }
>reporte_id: { type: integer, required: true, primaryKey: true,
> foreignTable: reporte, foreignReference: id_reporte }
>  reporteTaller:
>_attributes:   { phpName: RTaller }
>id_reporte:   

Re: [symfony-users] jquery validation

2011-02-15 Thread Gareth McCumskey
Try asking on the jquery forums etc.

http://plugins.jquery.com/project/jqueryvalidate

On Tue, Feb 15, 2011 at 11:53 PM, Laxmi  wrote:

> i am trying to do validation by using j query but it is not working
> can any one help me please
>
> $("#form_register").validate({
>
>rules: {
>"user[username]":  "required",
>"user[first_name]":
> "required",
>"user[last_name]": "required",
>
>"user[email]": {
>required: true,
>email: true
>},
>"user[password]":  "required"
>
>
>}
>
>});
>$("user[username]
> name:last").addClass("error");
>});
>
> --
> 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@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] error

2011-02-15 Thread Gareth McCumskey
Is your action called executeCreate? If so, what is happening is that your
if condition is not being met so it does not hit your $this->setTemplate()
call and so continues on to try and find the default template for the
executeCreate action called createSuccess.php and errors out because you
have not created it.

Thats all I can offer seeing as you haven't included much information
regarding the problem or much code to look at.

On Tue, Feb 15, 2011 at 11:52 PM, Laxmi  wrote:

> I am hear trying to find weather email is existing in database or not
> but i am getting error The template "create.php" does not exist
> symfony. Please help
>
>
>
> $user = $this->user;
> $user = Doctrine_Core::getTable('user')
>  ->createQuery('a')
>  ->where('a.email = ?',$email)
>  ->execute();
>
>
> if($user == false){
> $this->form = new userForm();
> $this->form->getwidgetSchema()->setNameFormat('user[%s]');
> $this->form -> bind($req);
> $friendlynationuser = $this->form ->save();
> $this->setTemplate('new');
> }
>
> --
> 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@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Extension load() config

2011-02-15 Thread Michael
I have updated to the latest Symfony and implement the load() to all
my bundles:

-public function configLoad(array $configs, ContainerBuilder
$container)
+public function load(array $configs, ContainerBuilder $container)

also remove the ".config" from the /app/config/config.yml:

- search.config: ~
+ search: ~

but getting the following error:

Fatal error: Uncaught exception 'InvalidArgumentException' with
message 'There is no extension able to load the configuration for
"search" (in ../app/config/config.yml).' in ../vendor/symfony/src/
Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php:289
Stack trace: #0 ../vendor/symfony/src/Symfony/Component/
DependencyInjection/Loader/YamlFileLoader.php(261): Symfony\Component
\DependencyInjection\Loader\YamlFileLoader->validate(Array, '/Users/
hagaiari...') #1 ../vendor/symfony/src/Symfony/Component/
DependencyInjection/Loader/YamlFileLoader.php(44): Symfony\Component
\DependencyInjection\Loader\YamlFileLoader->loadFile('/Users/
hagaiari...') #2 ../vendor/symfony/src/Symfony/Component/Config/Loader/
FileLoader.php(57): Symfony\Component\DependencyInjection\Loader
\YamlFileLoader->load('/Users/hagaiari...') #3 ../vendor/ in ../vendor/
symfony/src/Symfony/Component/DependencyInjection/Loader/
YamlFileLoader.php on line 289

any ideas what I'm doing wrong? am I missing something?

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: Forms and validation

2011-02-15 Thread Bernhard Schussek
> Correct syntax for annotation-validators is to use parents in the end:
> email(), NotBlank()...

This is not true. You can leave away the parents just as well.

Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Forms and validation

2011-02-15 Thread Nikita Korotaev
Instead of using constructor, add a name in Create function:
$oForm = RegisterForm::create($this->get('form.context'), "Registration");

Correct syntax for annotation-validators is to use parents in the end:
email(), NotBlank()...

In all other cases your code seems to be valid. Your entity class doesn't 
need to extend any other class in order validators to work.

Regards,
Nikita
 

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Form validation

2011-02-15 Thread Christophe COEVOET

Le 15/02/2011 23:57, Lideln a écrit :

Since I cannot add new answers to the topic I created earlier (why
that ?), I create a new one here with additionnal info.

As I said, I followed the official tutorial to create a RegisterForm
and using it to register new members.
But I got stuck at the validation, because I got the error :
The option "validator" is required for validating

Here is my code, please can you tell me what I did wrong ?

[config.yml]
app.config:
 error_handler: null
 validation:{ enabled: true, annotations: true }

[controller]
$oRequest = new RegisterRequest();
$oForm = RegisterForm::create($this->get('form.context'));
You need to provide the name of the form here as a second argument. The 
doc of the master has been fixed for this point.


Regards

--
Christophe | Stof

--
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Form validation

2011-02-15 Thread Lideln
Since I cannot add new answers to the topic I created earlier (why
that ?), I create a new one here with additionnal info.

As I said, I followed the official tutorial to create a RegisterForm
and using it to register new members.
But I got stuck at the validation, because I got the error :
The option "validator" is required for validating

Here is my code, please can you tell me what I did wrong ?

[config.yml]
app.config:
error_handler: null
validation:{ enabled: true, annotations: true }

[controller]
$oRequest = new RegisterRequest();
$oForm = RegisterForm::create($this->get('form.context'));
$oForm->bind($this->get('request'), $oRequest);
if ($oForm->isValid())
{
echo 'Form valid !';
}

[form]
class RegisterForm extends Form
{
public function __construct()
{
parent::__construct('register');
}

protected function configure()
{
$this->add(new TextField('email', array('max_length' => 100)));
$this->add(new TextField('pseudo', array('max_length' => 18)));
$this->add(new PasswordField('password', array('max_length' =>
45)));
}
}

[domain object]
class RegisterRequest
{
/**
 * @validation:Email
 * @validation:MaxLength(100)
 * @validation:NotBlank
 */
protected $email;

/**
 * @validation:MaxLength(18)
 * @validation:NotBlank
 */
protected $pseudo;

/**
 * @validation:MaxLength(40)
 * @validation:NotBlank
 */
protected $password;

// getters and setters
}


Thank you all, any help is welcome !

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Forms and validation

2011-02-15 Thread Lideln
Hi Nikita,

Thanks for the answer.
I had already discovered the form name parameter. Only I fixed it by
creating a ctor in my form and calling
parent::__construct('register').
The topic you kindly gave me did not help. I still have the " The
option "validator" is required for validating  " error.
Just as if the validator was not existing in the context ($oForm =
RegisterForm::create($this->get('form.context'));)

Here is my code, is there anything wrong with it ?


[controller]
$oRequest = new RegisterRequest();
$oForm = RegisterForm::create($this->get('form.context'));
$oForm->bind($this->get('request'), $oRequest);
if ($oForm->isValid())
{
echo 'Form valid !';
}


[form]
class RegisterForm extends Form
{
public function __construct()
{
parent::__construct('register');
}

protected function configure()
{
$this->add(new TextField('email', array('max_length' => 100)));
$this->add(new TextField('pseudo', array('max_length' => 18)));
$this->add(new PasswordField('password', array('max_length' =>
45)));
}
}


[domain object]
class RegisterRequest
{
/**
 * @validation:Email
 * @validation:MaxLength(100)
 * @validation:NotBlank
 */
protected $email;

/**
 * @validation:MaxLength(18)
 * @validation:NotBlank
 */
protected $pseudo;

/**
 * @validation:MaxLength(40)
 * @validation:NotBlank
 */
protected $password;

  // getters and setters
}

[config]
app.config:
error_handler: null
validation:{ enabled: true, annotations: true }



On 15 fév, 17:23, Nikita Korotaev  wrote:
> There is no such thing like EmailField at the moment, I don't know why it's
> in docs. You should use textField and set Email validator instead.
> The form creation seem to be valid in docs, only missing the name parameter.
> Check this topic for more 
> information:https://groups.google.com/forum/#!topic/symfony-users/ylWVP5KsAEw
>
> Regards,
> Nikita

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] jquery validation

2011-02-15 Thread Laxmi
i am trying to do validation by using j query but it is not working
can any one help me please

$("#form_register").validate({

rules: {
"user[username]":  "required",
"user[first_name]":
"required",
"user[last_name]": "required",

"user[email]": {
required: true,
email: true
},
"user[password]":  "required"


}

});
$("user[username]
name:last").addClass("error");
});

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] error

2011-02-15 Thread Laxmi
I am hear trying to find weather email is existing in database or not
but i am getting error The template "create.php" does not exist
symfony. Please help



$user = $this->user;
 $user = Doctrine_Core::getTable('user')
  ->createQuery('a')
  ->where('a.email = ?',$email)
  ->execute();


 if($user == false){
 $this->form = new userForm();
 $this->form->getwidgetSchema()->setNameFormat('user[%s]');
 $this->form -> bind($req);
 $friendlynationuser = $this->form ->save();
 $this->setTemplate('new');
 }

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Forms and validation

2011-02-15 Thread Lideln
Hi Nikita,

Yes I already discovered the missing name by myself and added a
__construct() in my RegisterForm class, that is calling
parent::__construct('register') and it works fine.
But the validators don't work, I got this strange error as if a
Validation instance does not exist in the context ($this-
>get('form.context') ??).
Maybe I should make my RegisterRequest class extend some Validation
class ? Or am I missing some config.yml entries ?
I can give you my code this evening, I'm at the office right now.
Any help would be greatly appreciated (I have several questions
regarding sf2 but form validation will be enough for now ^^)

Kind regards,

Lideln

On 15 fév, 17:23, Nikita Korotaev  wrote:
> There is no such thing like EmailField at the moment, I don't know why it's
> in docs. You should use textField and set Email validator instead.
> The form creation seem to be valid in docs, only missing the name parameter.
> Check this topic for more 
> information:https://groups.google.com/forum/#!topic/symfony-users/ylWVP5KsAEw
>
> Regards,
> Nikita

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Integrating an html template in a symfony project

2011-02-15 Thread diengsallah
Hi all,
I have a static html web site wish is really nice for me (I mean the
design is beautifull).
Now, I want to make it dynamic using symfony. While symfony is an MVC
framework, I want to use my static web site as the view. Is it
possible ? If so, can you help me to start ?
thank you very much.

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Fatal error: Class 'BaseForm' not found

2011-02-15 Thread dietercubano
Hi comunity! My projects now show that:
Fatal error: Class 'BaseForm' not found in C:\Documents and Settings
\Desarrollo Web\Mis documentos\NetBeansProjects\reportes\plugins
\sfGuardPlugin\lib\form\BasesfGuardFormSignin.class.php on line 3
after installed sfGuardPlugin and change the schema.yml, could be
something with relations or something? i was trying create
BaseForm.class.php manually and build the model again but keeping this
error... this is my schema.yml:

propel:
  sf_guard_user_profile:
_attributes:   { phpName: sfGuardUserProfile }
id:~
user_id:   { type: integer, foreignTable: sf_guard_user,
foreignReference: id, required: true, onDelete: cascade }
first_name:varchar(20)
last_name: varchar(20)
created_at:
updated_at:
  cliente:
_attributes:   { phpName: Cliente }
id_cliente:{ type: varchar(10), required: true,
primaryKey: true }
cliente:   varchar(40)
created_at:
updated_at:
  servicio:
_attributes:   { phpName: Servicio }
id_serv:{ type: integer, required: true,
primaryKey: true, autoIncrement: true }
servicio:   varchar(40)
created_at:
updated_at:
  sf_guard_user_profile_has_servicio:
sf_guard_user_profile_id: { type: integer, required: true,
primaryKey: true, foreignTable: sf_guard_user_profile,
foreignReference: user_id }
reporte_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, foreignReference: id_serv }
  cuenta:
_attributes:   { phpName: Cuenta }
id_cuenta:  { type: integer, required: true,
primaryKey: true, autoIncrement: true }
sf_guard_permission_id: { type: INTEGER, required: true,
foreignTable: sf_guard_permission, foreignReference: id, onDelete:
RESTRICT, onUpdate: RESTRICT }
created_at:
updated_at:
  sf_guard_user_profile_has_cuenta:
sf_guard_user_profile_id: { type: integer, required: true,
primaryKey: true, foreignTable: sf_guard_user_profile,
foreignReference: user_id }
cuenta_id: { type: integer, required: true, primaryKey: true,
foreignTable: cuenta, foreignReference: id_cuenta }
  cuentaTaller:
_attributes:   { phpName: CTaller }
id_cuenta:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
created_at:
updated_at:
  servicio_has_cuentaTaller:
servicio_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, foreignReference: id_serv }
cuenta_id: { type: integer, required: true, primaryKey: true,
foreignTable: cuentaTaller, foreignReference: id_cuenta }
  cuentaRedes:
_attributes:   { phpName: CRedes }
id_cuenta:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
created_at:
updated_at:
  servicio_has_cuentaRedes:
servicio_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, foreignReference: id_serv }
cuenta_id: { type: integer, required: true, primaryKey: true,
foreignTable: cuentaRedes, foreignReference: id_cuenta }
  cuentaConectividad:
_attributes:   { phpName: CConectividad }
id_cuenta:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
created_at:
updated_at:
  servicio_has_cuentaConectividad:
servicio_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, foreignReference: id_serv }
cuenta_id: { type: integer, required: true, primaryKey: true,
foreignTable: cuentaConectividad, foreignReference: id_cuenta }
  cuentaRodas:
_attributes:   { phpName: CRodas }
id_cuenta:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
created_at:
updated_at:
  servicio_has_cuentaRodas:
servicio_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, foreignReference: id_serv }
cuenta_id: { type: integer, required: true, primaryKey: true,
foreignTable: cuentaRodas, foreignReference: id_cuenta }
  reporte:
_attributes:   { phpName: CReporte }
id_reporte:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
sf_guard_permission_id: { type: INTEGER, required: true,
foreignTable: sf_guard_permission, foreignReference: id, onDelete:
RESTRICT, onUpdate: RESTRICT }
created_at:
updated_at:
  sf_guard_user_profile_has_reporte:
sf_guard_user_profile_id: { type: integer, required: true,
primaryKey: true, foreignTable: sf_guard_user_profile,
foreignReference: user_id }
reporte_id: { type: integer, required: true, primaryKey: true,
foreignTable: reporte, foreignReference: id_reporte }
  reporteTaller:
_attributes:   { phpName: RTaller }
id_reporte:   { type: integer, required: true,
primaryKey: true, autoIncrement: true }
created_at:
updated_at:
  servicio_has_reporteTaller:
servicio_id: { type: integer, required: true, primaryKey: true,
foreignTable: servicio, f

Re: [symfony-users] [Symfony2] - Choicefield empty_value

2011-02-15 Thread Bernhard Schussek
Hi,

This is intended behaviour. An empty value is only displayed if a
field is not required. Through the "empty_value" option you can change
the label of that empty value.

Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Odd Doctrine behavior in form processing

2011-02-15 Thread Yitzchak Schaffer

Hello,

I am encountering unexpected behavior with form processing, symfony 1.4 
with Doctrine. I have a table which has a many-to-many relationship to 
itself:


Person:
  [...]
  relations:
Teachers:
  class: Person
  refClass: PersonTeacher
  local: student_id
  foreign: teacher_id
  foreignAlias: Students

In Person, I have a method which gets called in PersonForm for use in a 
custom widget:


public function getTeachersOrderByName()
{
  $q = Doctrine::getTable('Person')
->createQuery('t')
->leftJoin('t.Students s')
->where('s.id = ?', $this->getId())
->orderBy('t.last_name, t.first_name ASC');

  return $q->execute();
}

Without that method call, Doctrine correctly INSERTs and DELETEs records 
from PersonTeacher. But when I call that method in the PersonForm, the 
following UPDATE is run on saving the form [taken from the logs]:


Doctrine_Connection->update(object('PersonTeacherTable'), 
array('student_id' => '9'), array('teacher_id' => '9', 'student_id' => '6'))


which throws

SQLSTATE[23000]: Integrity constraint violation: 19 columns teacher_id, 
student_id are not unique


Backtrace:

at Doctrine_Connection_Statement->execute(array('9', '9', '6'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php 
line 1042 ...
at Doctrine_Connection->exec('UPDATE teacher_person SET student_id = ? 
WHERE teacher_id = ? AND student_id = ?', array('9', '9', '6'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection.php 
line 653 ...
at Doctrine_Connection->update(object('TeacherPersonTable'), 
array('student_id' => '9'), array('teacher_id' => '9', 'student_id' => '6'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php 
line 534 ...

at Doctrine_Connection_UnitOfWork->update(object('TeacherPerson'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php 
line 89 ...

at Doctrine_Connection_UnitOfWork->saveGraph(object('TeacherPerson'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php 
line 1718 ...

at Doctrine_Record->save(object('Doctrine_Connection_Sqlite'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection.php 
line 910 ...

at Doctrine_Collection->save(object('Doctrine_Connection_Sqlite'), 1)
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php 
line 136 ...

at Doctrine_Connection_UnitOfWork->saveGraph(object('Person'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php 
line 1718 ...

at Doctrine_Record->save(object('Doctrine_Connection_Sqlite'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection.php 
line 910 ...

at Doctrine_Collection->save(object('Doctrine_Connection_Sqlite'), )
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php 
line 445 ...

at Doctrine_Connection_UnitOfWork->saveAssociations(object('Person'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php 
line 142 ...145.

at Doctrine_Connection_UnitOfWork->saveGraph(object('Person'))
in 
SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php 
line 1718 ...

at Doctrine_Record->save(object('Doctrine_Connection_Sqlite'))
in SF_SYMFONY_LIB_DIR/form/addon/sfFormObject.class.php line 161 ...
at sfFormObject->doSave(object('Doctrine_Connection_Sqlite'))
in SF_ROOT_DIR/lib/form/doctrine/base/BasePersonForm.class.php line 116 ...
at BasePersonForm->doSave(object('Doctrine_Connection_Sqlite'))
in SF_SYMFONY_LIB_DIR/form/addon/sfFormObject.class.php line 130 ...

This only occurs when the many-to-many refers to the same table. I also 
have a one-to-many referring to its own table, and it works correctly. 
Is this a known issue?


Thank you very much,

--
Yitzchak Schaffer

--
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: - EntityChoicField

2011-02-15 Thread jdewit
Very nice! 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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: - EntityChoicField

2011-02-15 Thread Damon Jones
I was intrigued, so I tested it myself and can confirm that it works
using an accessor.

Alternatively, you could modify the __toString() method which is used
by default if nothing is provided for the property value in the
options array.

// Form:
$this->add(new EntityChoiceField('salesRep', array(
'em' => $em,
'empty_value' => 'Select',
'class' => 'Sensio\HelloBundle\Entity\User',
'property' => 'fullname',
'query_builder' => function ($userRepository) {
return
$userRepository->createQueryBuilder('u')->where('u.active
= ?1')->setParameter(1, '1');
},
)));

// Entity:
public function getFullname()
{
return $this->getFirstname() . ' ' . $this->getLastname();
}

On Feb 15, 8:55 am, Bernhard Schussek  wrote:
> 2011/2/14 Damon Jones :
>
> > Why not have a getFullname() accessor method in your user entity which
> > returns first and last name concatenated and use that property?
>
> This should work. If it doesn't, that's a bug.
>
> Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Admin generator preferences panel

2011-02-15 Thread Richtermeister
Hey Felds,

In the past I have dealt with this by just putting a "SettingsForm"
into the admin area (styling it to look the same as an admin module),
and writing the settings to a yml file.
During runtime I then load the file and merge it with the settings in
sfConfig. This way I can allow admins to override specific app_ or sf_
settings throughout the app. Since the logic which fields you want to
expose, and how you want to validate them is completely contained
inside the form class, it's really quite easy to manage for me.

That help?
Daniel


On Feb 14, 5:20 am, Felds Liscia  wrote:
> This is more of a conceptual question.
>
> Sometimes I have to make some configs available to my clients but
> those configs don't fit in a CRUD pattern, like tuning promos on/off,
> setting metas, titles, and those things.
>
> In your opinion, what is the best way to build this kind of
> preferences panel using the admin generator?
>
> I often strip down the module actions to execute only the Edit and
> Update actions, but the routing becomes a mess and I'm not sure if
> this kind of things should go on a DB table with a single row.
> It's far from perfect.
>
> Thank you in advance. ;-)
>
> @felds

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Forms and validation

2011-02-15 Thread Justin Fortier
There used to be an email field from what I've heard, but it's
redundant because of the textfield. The only reason the url field is
there, is because you can set it up for different protocols.

On Feb 15, 11:23 am, Nikita Korotaev  wrote:
> There is no such thing like EmailField at the moment, I don't know why it's
> in docs. You should use textField and set Email validator instead.
> The form creation seem to be valid in docs, only missing the name parameter.
> Check this topic for more 
> information:https://groups.google.com/forum/#!topic/symfony-users/ylWVP5KsAEw
>
> Regards,
> Nikita

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: [SF2] Forms and validation

2011-02-15 Thread Nikita Korotaev
There is no such thing like EmailField at the moment, I don't know why it's 
in docs. You should use textField and set Email validator instead. 
The form creation seem to be valid in docs, only missing the name parameter. 
Check this topic for more information:
https://groups.google.com/forum/#!topic/symfony-users/ylWVP5KsAEw

Regards,
Nikita

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] sfJqueryReloadedPlugin -> show loading

2011-02-15 Thread hribo
Hi guys,
how to achieve to display loader using *jq_submit_to_remote* method?

 'change_zone',
*'loading' => "#loading", //???*
'url' => url_for('fotografia_send_contactmail'),
  ))
 ?>

in my template is already div with id="loading"

thank you

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: [symfony2][PR6] - create form with setDataClass and multiple entities

2011-02-15 Thread Bernhard Schussek
> The validator returns "This value should not be blank" two times for
> each field with @validation:NotBlank() if I submit the form empty
> This behaviour occurs only with fields of the second entity
> (translation).

This is a known bug.

Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Why doesn't sfOutputEscaperArrayDecorator escape keys?

2011-02-15 Thread Basil Hussain
I was checking the validity of my project's HTML and noticed that some
things weren't being escaped properly. After investigating, I
discovered the problems were in certain places where I am outputting
an array with string keys.

Basically, in my code I am doing this:

// Action
$this->foo = array('<<' => 'bbb', '1' => 'aaa', '2' => 'bbb', '3' =>
null, '4' => 'ddd', '>>' => 'ddd');

// Template
 $v) ?>



The $foo template value, being an array, obviously gets converted to
an instance of sfOutputEscaperArrayDecorator. But, I discovered that
sfOutputEscaperArrayDecorator does not apply any escaping to keys, but
only values! So where, as I am doing, you are iterating over the array
and want to output both value *and* key, you get broken HTML where
your keys happen to contain special characters.

Is there any particular reason why sfOutputEscaperArrayDecorator
doesn't escape keys?

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: [Symfony2] Executing code before the controller action was called

2011-02-15 Thread Gábor Fási
My bad, didn't see the Sf2 flag in the subject.

On Tue, Feb 15, 2011 at 14:21, Justin Fortier  wrote:
> Your solution is Symfony 1.4 based, I'm not sure how this is all
> handled in Symfony2.
>
> Nikita, I'm also trying to implement something similar in nature, I'll
> let you know if I find a solution.
>
> On Feb 14, 3:13 pm, Gábor Fási  wrote:
>> This is exactly what the Advanced Routing chapter of the More with
>> symfony book is 
>> about:http://www.symfony-project.org/more-with-symfony/1_4/en/02-Advanced-R...
>>
>>
>
> --
> 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@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: - EntityChoicField

2011-02-15 Thread Bernhard Schussek
2011/2/14 Damon Jones :
> Why not have a getFullname() accessor method in your user entity which
> returns first and last name concatenated and use that property?

This should work. If it doesn't, that's a bug.

Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] symfony2 RepeatedField

2011-02-15 Thread Bernhard Schussek
Hi Andras,

Please don't cross post. I have answered your question in your
previous thread already.

Bernhard

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] symfony2 RepeatedField

2011-02-15 Thread Andras
Hi,

I have added a RepeatedField to a form:

$enterprise->add(new RepeatedField(new PasswordField('password'),
array('first_key' => 'password', 'second_key' => 'password_again')));

How can I change the labels Password and Password again in Twig?

{{ form_label(form.enterprise.password, 'Password') }}:
{{ form_field(form.enterprise.password) }}

Regards,

Andras

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] symfony2 twig subform error messages

2011-02-15 Thread Andras
Hi,

I'm trying to print the error messages for the fields of the subform
called enterprise in twig:

If I do it like this no messages appear (except for
form_errors(form.termsAccepted)):

{{ form_errors(form) }}
{{ form_errors(form.enterprise.username) }}
{{ form_label(form.enterprise.username) }}:
{{ form_field(form.enterprise.username) }}
{{ form_errors(form.enterprise.contact_name) }}
{{ form_label(form.enterprise.contact_name) }}:
{{ form_field(form.enterprise.contact_name) }}
{{ form_errors(form.enterprise.contact_email) }}
{{ form_label(form.enterprise.contact_email) }}:
{{ form_field(form.enterprise.contact_email) }}
{{ form_errors(form.enterprise.password.first) }}
{{ form_label(form.enterprise.password.first) }}:
{{ form_field(form.enterprise.password.first) }}
{{ form_errors(form.enterprise.password.second) }}
{{ form_label(form.enterprise.password.second) }}:
{{ form_field(form.enterprise.password.second) }}
{{ form_errors(form.termsAccepted) }}
{{ form_field(form.termsAccepted) }}
{{ form_label(form.termsAccepted) }}
{{ form_hidden(form) }}

If I write {{ form_errors(form.enterprise) }} to the top it shows all
of the subform error messages at once at the top of the form. Is this
a bug or am I doing something the wrong way?

Andras

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [SF2] Forms and validation

2011-02-15 Thread Lideln
Hi there,

I have been experimenting with the PR6 lately.
Now I'm stuck with the forms and validation, and kinda need some tips.

I followed the official tutorial, and I succeeded in creating a form
and displaying it (but two minor things : I did not see an EmailField
in the code, and I could not find a way to specify the label).
Though, when it came to validation, I created a RegisterRequest with
annotations for validation, but when submitting the form, I got this
error :
The option "validator" is required for validating
Please note that I activated the validation in the config.yml

Thank you all (if you have a link to more up to date tutorials, I
would love to have it, thank you :) )

Lideln

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: [Symfony2] Executing code before the controller action was called

2011-02-15 Thread Justin Fortier
Your solution is Symfony 1.4 based, I'm not sure how this is all
handled in Symfony2.

Nikita, I'm also trying to implement something similar in nature, I'll
let you know if I find a solution.

On Feb 14, 3:13 pm, Gábor Fási  wrote:
> This is exactly what the Advanced Routing chapter of the More with
> symfony book is 
> about:http://www.symfony-project.org/more-with-symfony/1_4/en/02-Advanced-R...
>
>

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: sfWidgetFormPropelChoice newbie problem help needed please

2011-02-15 Thread Massimiliano Arione
You're code is a mess... you should really really try to clean it.
Why the hell are you putting logic in your template? :-(

cheers
Massimiliano

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: embedRelation updating an object with null attributes (Propel)

2011-02-15 Thread Massimiliano Arione
Embedded form is updated in form itself (in your case, in EventDateForm).
So, you can try to juggle with that form's methods (doSave and 
doUpdateObject)

cheers
Massimiliano

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] (Doctrine?) Bug with last insert ID and composite primary keys which have an auto_increment member

2011-02-15 Thread Fred
What is the bug:

When a Doctrine_Record is saved (using save()) _id is not fully updated. 

This problem is occurring for me using MySQL, with tables that have 
composite primary keys (and columns that need it do have auto_increment 
set). The schema was auto-generated from the database, and the model from 
that schema. I am using a fresh install of symfony 1.4 (as of last week).

Debugging this showed that _assignIdentifier(Doctrine_Record $record) 
in*/Doctrine/Connection/UnitOfWork.php
* always ultimately called $record->assignIdentifier(true) and never 
therefore retrieved the last insert id. 

Further debugging in */Doctrine/Record.php* shows that:

1) public function assignIdentifier($id = false) will always call 
$this->prepareIdentifiers(true)
2) private function prepareIdentifiers($exists = true) will for type 
Doctrine_Core::IDENTIFIER_COMPOSITE 
merely copy into $this->_id any currently valid data from the table - and 
hence will always miss the auto increment column.

I do have a 'dirty fix' - which will is safe for my use of symfony (as the 
auto_increment column is always first in my tables with composite keys). The 
fix is to:

1) Get the last sql insert id before calling $record->assignIdentifier(true)
2) In the case when a composite key is being processed - if there is no data 
for the first primary key, set it to the last sql insert id if it exists (as 
now passed in via assignIdentifier and prepareIdentifiers).

This works fine - and I can now do:

$foo->save();
$foo = FooTable::getInstance()->find($foo->identifier());

The changes (CVS diff against symfony 1.4) are:

===
RCS file: 
vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php,v
retrieving revision 1.1
diff -r1.1 Record.php
760a761
>  * @param mixed $id - $id to use if none found in a composite 
identifier
763c764
< private function prepareIdentifiers($exists = true)
---
> private function prepareIdentifiers($exists = true, $id = -1)
781a783
> $count = 0;
784a787,790
> if($count == 0 && $id != -1)
> {
> $this->_id[$name] = $id;
> }
787a794
> $count++;
2228a2236
>  * @param mixed $tempId a key value from SQL last insert ID (for use 
in composite key ID assignment)
2231c2239
< public function assignIdentifier($id = false)
---
> public function assignIdentifier($id = false, $newId = -1)
2239c2247
< $this->prepareIdentifiers(true);
---
> $this->prepareIdentifiers(true, $newId);

Index: 
vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php
===
RCS file: 
vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php,v
retrieving revision 1.1
diff -r1.1 UnitOfWork.php
936d935
< 
957c956,957
< $record->assignIdentifier(true);
---
> $id = $this->conn->sequence->lastInsertId();
> $record->assignIdentifier(true, $id);


I am not sure if this is a schema or model generation bug or a doctrine bug 
and I am new to symfony (as of last week) so there may be a better 
workaround or fix, however the fix above was the quickest way for me to 
solve them problem.

Any thoughts welcome.

-- 
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@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en