You should probably use the $form->offsetUnset('widgetName'); and
make sure it exists using $form->offsetExists('widgetName');
might do some cleaning up a bit more.
On Jul 14, 11:49 am, "Olivier Revollat" <[EMAIL PROTECTED]> wrote:
> Hello !!
> I have some generated code to manage my users (from sfGuard schema).
> I have done :
>
> propel:generate-crud frontend users sfGuardUser --with-show
>
> but I don't want to edit the 'created_at' column since it's automatically
> fill ... so I just unset it inside the configure() method of the base form
> as explain in the doc :
>
> class sfGuardUserForm extends BasesfGuardUserForm
> {
> public function configure()
> {
>
> unset($this->widgetSchema['created_at']);
> unset($this->validatorSchema['created_at']);
> }
>
> }
>
> But when I want to edit or crate a user (call to sfGuardUserForm) their is
> an exception :
>
> [InvalidArgumentException]
> *Widget "created_at" does not exist.*
> stack trace
>
> * at ()
> in SF_SYMFONY_LIB_DIR\form\sfForm.class.php line 718 ...
> 715. {
> 716. if (!$widget = $this->widgetSchema[$name])
> 717. {
> 718. throw new InvalidArgumentException(sprintf('Widget
> "%s" does not exist.', $name));
> 719. }
> 720.
>
> 721. $values = $this->isBound ? $this->taintedValues :
> $this->defaults;
> * at sfForm->offsetGet('created_at')
> in SF_ROOT_DIR\apps\frontend\modules\users\templates\editSuccess.php
> line 50
>
> I don't understand because I have already tested this when I read the
> "symfony form book".
> It doesn't work neither if I try other colum like "is_active" .. i got the
> same exception ... !!!
>
> Can you help please ?
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---