i get the error when i try to edit an record.

create and delete works fine but if i try to edit an record and dont select
any file when i hit save the required error appears.

Thanks

Celso

On Fri, Dec 11, 2009 at 5:11 AM, Alexandru-Emil Lupu
<gang.al...@gmail.com>wrote:

> When you get that required error? Better what are you trying to achieve?
>
> sent via htc magic
>
> On Dec 11, 2009 1:11 AM, "g0d br" <g0d...@gmail.com> wrote:
>
> Hi,
>
> I have an schema like this:
>
> banner:
>     id: ~
>     ordem: { type: integer, required: true }
>     imagem: { type: varchar(255), required: true }
>     link: { type: varchar(255), required: false }
>
> When i edit an record in admin module i get an error Required for imagem
> field.
>
> Thats the code in BannerForm.class.php
>
>     parent::configure();
>
>     $this->widgetSchema['imagem'] = new
> sfWidgetFormInputFileEditable(array(
>       'label'     => 'Imagem 630x288',
>       'file_src'  => '/uploads/banner/'.$this->getObject()->getImagem(),
>       'is_image'  => true,
>       'edit_mode' => !$this->isNew(),
>       'delete_label' => 'Remover imagem',
>       'template'  => '<div>%file%<br />%input%<br />%delete%
> %delete_label%</div>',
>     ));
>     /*
>     $this->widgetSchema['imagem'] = new sfWidgetFormInputFile(array(
>       'label' => 'Imagem 630x288',
>     ));
>     */
>
>     $this->validatorSchema['imagem'] = new sfValidatorFile(array(
>       'required'   => true,
>       'path'       => sfConfig::get('sf_upload_dir').'/banner',
>       'mime_types' => 'web_images',
>     ));
>
>     $this->validatorSchema['imagem_delete'] = new sfValidatorBoolean();
>
> What an my doing wrong here? this code i get from symfony docs.
>
> Thank You
>
>
> Celso
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@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.


Reply via email to