FriendsOfSymfony/FOSUserBundle — Issue #383: Could not load type "XYZ" error when overriding form types
Author: thriveagency
Created: 2011-10-26 13:41:15+00:00
State: open

I have tried this every-way i can see how and still seem to be seeing the same error. I am following the documentation to override the RegistrationFormType. I believe i've followed the documentation entirely but i'm finding i continue to get the "Could not load type" error. I've created a bundle to contain my overrides to the FOSUserBundle.

The following are bits from this bundle and the app config file.

RegistrationFormType.php

```php

*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Thrive\SaasBundle\Form\Type;

use Symfony\Component\Form\FormBuilder;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;

class RegistrationFormType extends BaseType
{

public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('firstname', null, array('error_bubbling' => true))
->add('lastname', null, array('error_bubbling' => true))
->add('company', null, array('error_bubbling' => true))
->add('email', 'email', array('error_bubbling' => true))
->add('username', null, array('error_bubbling' => true))
->add('plainPassword', 'repeated', array('type' => 'password', 'error_bubbling' => true))
;
}

public function getName()
{
return 'thrive_user_registration';
}

}
```
Services.yml

```yaml
services:
thrive_saas_registration.form.type:
class: Thrive\SaasBundle\Form\Type\RegistrationFormType
arguments: [%fos_user.model.user.class%]
tags:
- { name: form.type, alias: thrive_user_registration}
```

Application's Config File

```yaml
fos_user:
...
registration:
form:
type: thrive_user_registration
```

Has anyone experienced this, or see anything in my code that would help explain this.

I'm on symfony v2.0.4

Thanks