PUGX / PUGXMultiUserBundle

An extension for FOSUserBundle to handle users of different types. Compatible with Doctrine ORM.
163 stars 96 forks source link

Unrecognized options "users" under "pugx_user" #16

Closed gelhaimer closed 11 years ago

gelhaimer commented 11 years ago

Hi there,

I'm new to Symfony2 and Git. I dont know hot to put under light my code. If you would edit it, feel free to do.

I met this error after having configured my bundle to allow a specific hierarchy of entities: Unrecognized options "users" under "pugx_user"

It seems that this file is in cause:

//Provocation/UserBundle/Resources/config/config.yml pugx_multi_user: users: candidat: entity: class: Provocation\UserBundle\Entity\Candidat

factory:

           registration:
               form: 
                   type: Provocation\UserBundle\Form\Type\CandidatRegistrationFormType
                   name: fos_user_registration_form
                   validation_groups:  [Registration, Default]
               template: ProvocationUserBundle:Registration:user_one.form.html.twig
           profile:
             form:
                 type: Provocation\UserBundle\Form\Type\ProfileUserOneFormType
                 name: fos_user_profile_form
                 validation_groups:  [Profile, Default] 
       support:
           entity: 
               class: Provocation\UserBundle\Entity\Support
           registration:
               form: 
                   type: Provocation\UserBundle\Form\Type\SupportRegistrationFormType
               template: ProvocationUserBundle:Registration:user_two.form.html.twig
           profile:
               form: 
                   type: Provocation\UserBundle\Form\Type\ProfileUserTwoFormType

It is a real problem since I can not do anything from now on. Everything has been made as explained if you documentation (maybe not totaly since i've this error). So controllers, forms and entities are made.

I have absolutly no idea about where it comes from. I have checked if the indent were OK in my config.yml, but seems like nothing is wrong in it.

There is how my composer.json is configured (I use Sf2.1.8):

"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    "doctrine/orm": ">=2.2.3,<2.5-dev",
    "doctrine/doctrine-bundle": "1.1.*",
    "twig/extensions": "1.0.*@dev",
    "symfony/assetic-bundle": "2.1.*",
    "symfony/swiftmailer-bundle": "2.1.*",
    "symfony/monolog-bundle": "2.1.*",
    "sensio/distribution-bundle": "2.1.*",
    "sensio/framework-extra-bundle": "2.1.*",
    "sensio/generator-bundle": "2.1.*",
    "jms/security-extra-bundle": "1.2.*",
    "jms/di-extra-bundle": "1.1.*",
    "kriswallsmith/assetic": "1.1.*@dev",
    "friendsofsymfony/user-bundle": "*",
    "pugx/multi-user-bundle": "1.4.x-dev"
},
leopro commented 11 years ago

for 1.4: https://github.com/PUGX/PUGXMultiUserBundle/blob/1.4/Resources/doc/index.md

gelhaimer commented 11 years ago

It still does not work. Actually, in the documentation you linked to me, there no values for parameter "factory" in config.yml.

So, Symfony reports me this error :

ParseException: Indentation problem in "myconfigfile.yml" at line 8 (near "factory:").

It seems that Symfony does not accept yaml parameters without values. I've checked the indentation and there is 4 spaces as necessary.

So what is the value I must provide to factory ?

leopro commented 11 years ago

anyway, with sf2.1.* you can use the master branch that is in sync with fosub master.

{
    "require": {
        "pugx/multi-user-bundle": "master-dev"
    }
}

without

"friendsofsymfony/user-bundle": "*"

because with composer, dependencies are hierarchical.