0
votes

I tried to unset the widget "password_again" from the sfGuardUserAdminForm on the backend app. But nothing works.

I try to not-displaying in the generator.yml file

form:
    class: sfGuardUserAdminForm
    display:
      "User":                   [first_name, last_name, email_address, username]
      "Permissions and groups": [is_active, is_super_admin, groups_list, permissions_list]

But the field stills appears in the form. And I try to unset on the form configure unset($this['password_again']);

But an error appears Widget "password_again" does not exist.

1
How are you rendering your form? It seems that you try to render the password_again field (and it does not exist, because you unset it) - Intru

1 Answers

0
votes

In /plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardUserAdminForm.class.php Comment next line

//  $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword();
//    $this->validatorSchema['password_again'] = clone $this->validatorSchema['password'];
//
//    $this->widgetSchema->moveField('password_again', 'after', 'password');
//
//    $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.')));

In sfGuardUserAdminForm.class.php

unset($this['password_again']); 

And del it from generator.yml