8000 FOS\UserBundle\Form\Type\ProfileFormType::getDefaultOptions() Error · Issue #599 · FriendsOfSymfony/FOSUserBundle · GitHub
[go: up one dir, main page]

Skip to content

FOS\UserBundle\Form\Type\ProfileFormType::getDefaultOptions() Error #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fariazz opened this issue Apr 11, 2012 · 11 comments
Closed

FOS\UserBundle\Form\Type\ProfileFormType::getDefaultOptions() Error #599

fariazz opened this issue Apr 11, 2012 · 11 comments

Comments

@fariazz
Copy link
fariazz commented Apr 11, 2012

After running php bin/vendors install, I get the following error when I try to run any app/console command:

PHP Fatal error:  Declaration of FOS\UserBundle\Form\Type\ProfileFormType::getDefaultOptions() must be compatible with that of Symfony\Component\Form\FormTypeInterface::getDefaultOptions() in /home/myuser/www/my_project/vendor/bundles/FOS/UserBundle/Form/Type/ProfileFormType.php on line 66

I'm not using ProfileFormType in my code at all.

@willdurand
Copy link
Member

Which version of Symfony2 do you use? I guess not the master one. Then, you have to use a tag instead of dev-master for friendsofsymfony/user-bundle in your composer.json file.

@jalliot
Copy link
jalliot commented Apr 11, 2012

Run php bin/vendors update to update symfony to the latest version (see symfony/symfony#3789)

@fariazz
Copy link
Author
fariazz commented Apr 11, 2012

I'm using symfony 2.0.10, I think I should be pointing to the master branch, this is my deps file

[symfony]
    git=git://github.com/symfony/symfony.git
    version=v2.0.10

[twig]
    git=git://github.com/fabpot/Twig.git
    version=v1.4.0

[monolog]
    git=git://github.com/Seldaek/monolog.git
    version=1.0.2

[doctrine-common]
    git=git://github.com/doctrine/common.git
    version=2.1.4

[doctrine-dbal]
    git=git://github.com/doctrine/dbal.git
    version=2.1.5

[doctrine]
    git=git://github.com/doctrine/doctrine2.git
    version=2.1.4

[swiftmailer]
    git=git://github.com/swiftmailer/swiftmailer.git
    version=v4.1.3

[assetic]
    git=git://github.com/kriswallsmith/assetic.git
    version=v1.0.2

[twig-extensions]
    git=git://github.com/fabpot/Twig-extensions.git

[metadata]
    git=git://github.com/schmittjoh/metadata.git
    version=1.0.0

[SensioFrameworkExtraBundle]
    git=git://github.com/sensio/SensioFrameworkExtraBundle.git
    target=/bundles/Sensio/Bundle/FrameworkExtraBundle
    version=origin/2.0

[JMSSecurityExtraBundle]
    git=git://github.com/schmittjoh/JMSSecurityExtraBundle.git
    target=/bundles/JMS/SecurityExtraBundle
    version=origin/1.0.x

[SensioDistributionBundle]
    git=git://github.com/sensio/SensioDistributionBundle.git
    target=/bundles/Sensio/Bundle/DistributionBundle
    version=origin/2.0

[SensioGeneratorBundle]
    git=git://github.com/sensio/SensioGeneratorBundle.git
    target=/bundles/Sensio/Bundle/GeneratorBundle

[AsseticBundle]
    git=git://github.com/symfony/AsseticBundle.git
    target=/bundles/Symfony/Bundle/AsseticBundle
    version=v1.0.1

[FOSUserBundle]
    git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
    target=bundles/FOS/UserBundle

[gedmo-doctrine-extensions]
    git=git://github.com/l3pp4rd/DoctrineExtensions.git

[DoctrineExtensionsBundle]
    git=git://github.com/stof/StofDoctrineExtensionsBundle.git
    target=/bundles/Stof/DoctrineExtensionsBundle

[JMSTranslationBundle]
    git=git://github.com/schmittjoh/JMSTranslationBundle.git
    target=/bundles/JMS/TranslationBundle

[php-parser]
    git=git://github.com/nikic/PHP-Parser.git

[JsFormValidationBundle]
    git=git://github.com/Abhoryo/APYJsFormValidationBundle.git
    target=bundles/APY/JsFormValidationBundle

[ExposeTranslationBundle]
    git=git://github.com/willdurand/BazingaExposeTranslationBundle.git
    target=/bundles/Bazinga/ExposeTranslationBundle

[WebProfilerExtraBundle]
    git=git://github.com/Elao/WebProfilerExtraBundle.git
    target=bundles/Elao/WebProfilerExtraBundle

[phpExcel]
    git=git://github.com/fariazz/PHPExcel.git
    target=phpexcel/lib/

[AliDatatableBundle]
    git=git://github.com/AliHichem/AliDatatableBundle
    target=bundles/Ali/DatatableBundle

[JMSDiExtraBundle]
    git=https://github.com/schmittjoh/JMSDiExtraBundle.git
    target=/bundles/JMS/DiExtraBundle
    version=1.0.0

; Dependencies:
;--------------
[metadata]
    git=https://github.com/schmittjoh/metadata.git
    version=1.1.0 ; <- make sure to get 1.1, not 1.0

[JMSAopBundle]
    git=https://github.com/schmittjoh/JMSAopBundle.git
    target=/bundles/JMS/AopBundle

[cg-library]
    git=https://github.com/schmittjoh/cg-library.git
    target=/cg-library

[gherkin]
    git=git://github.com/Behat/Gherkin.git
    target=/behat/gherkin

[behat]
    git=git://github.com/Behat/Behat.git
    target=/behat/behat

[BehatBundle]
    git=git://github.com/Behat/BehatBundle.git
    target=/bundles/Behat/BehatBundle

[mink]
    git=https://github.com/Behat/Mink.git
    target=/behat/mink

[MinkBundle]
    git=https://github.com/Behat/MinkBundle.git
    target=/bundles/Behat/MinkBundle

@jalliot I ran this command but still getting the same error

@fariazz
Copy link
Author
fariazz commented Apr 11, 2012

composer.json in FOS/UserBundle

{
    "name": "friendsofsymfony/user-bundle",
    "type": "symfony-bundle",
    "description": "Symfony FOSUserBundle",
    "keywords": ["User management"],
    "homepage": "http://friendsofsymfony.github.com",
    "license": "MIT",
    "authors": [
        {
            "name": "Christophe Coevoet",
            "email": "stof@notk.org"
        },
        {
            "name": "Thibault Duplessis",
            "email": "thibault.duplessis@gmail.com"
        },
        {
            "name": "FriendsOfSymfony Community",
            "homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors"
        }
    ],
    "require": {
        "php": ">=5.3.2",
        "symfony/framework-bundle": "2.*",
        "symfony/security-bundle": "2.*"
    },
    "suggest": {
        "symfony/doctrine-bundle": "*",
        "symfony/mongodb-odm-bundle": "*",
        "doctrine/couchdb-odm-bundle": "*"
    },
    "autoload": {
        "psr-0": { "FOS\\UserBundle": "" }
    },
    "target-dir": "FOS/UserBundle"
}

@jalliot
Copy link
jalliot commented Apr 11, 2012

With Symfony 2.0 you need the 2.0 branch of this bundle.
In your deps file, change:

[FOSUserBundle]
    git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
    target=bundles/FOS/UserBundle

with:

[FOSUserBundle]
    git=git://github.com/FriendsOfSymfony/FOSUserBundle.git
    target=bundles/FOS/UserBundle
    version=origin/2.0

Then run php bin/vendors update

@willdurand
Copy link
Member

@jalliot Where is the 2.0 branch?

@fariazz
Copy link
Author
fariazz commented Apr 11, 2012

@jalliot added the "version=origin/2.0" to the deps file but got the same error

@stof
Copy link
Member
stof commented Apr 11, 2012

There is no 2.0 branch of this bundle as the master branch was still compatible with Symfony 2.0.x until the merge done too quickly (merging BC breaks too quickly is not a good idea). I think I will force the push to revert the merge, and then do a proper release before merging it again (even if a force push is evil).

@matteosister
Copy link

@stof why don't you create another commit that revert the change and start from there to do a proper release?

@jalliot
Copy link
jalliot commented Apr 11, 2012

Oops sorry spoke too quickly... Was sure there was a 2.0 branch like FOSRest and so on.

@stof
Copy link
Member
stof commented Apr 11, 2012

All: I just forced the push to reset the branch before the merge. If you are using bin/vendors update, it will do the job properly to go back to this version. Be careful if you do some git work yourself as you need to reset your master branch to the upstream one.
I will tag the 1.2 version of the bundle (compatible with Symfony 2.0 only as 2.1 broke the form type) and I will merge the PR again after that, bumping the requirement in the master branch. FOSUserBundle 1.2 will be the last release of the bundle supporting Symfony 2.0.x (we originally tallked about breaking BC between 1.1 and 1.2 but I had not had time for it so 1.2 can be released with the compatible changes). If you are still using Symfony 2.0.x, you will need to add version=1.2.0 in your deps file (once the tag wil be created in a few minutes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0