genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
587 stars 263 forks source link

Unrecognized options "configs" under "genenu_form.select2" #288

Closed klb-rodriguez closed 11 years ago

klb-rodriguez commented 11 years ago

Hello to everyone, I've tried to override the defaults config of select2 writing with the follow code in my config.yml file:

genemu_form: select2: enabled: true configs: placeholder: Select a value width: off allowClear: false minimumInputLength: 0

but I got the next error: Unrecognized options "configs" under "genenu_form.select2"

But if I use the default configuration it works fine!

Where I made a mistake?, thaks for help

klb-rodriguez commented 11 years ago

sorry I closed it by mistake

bamarni commented 11 years ago

@klb-rodriguez : this feature has just been added a few days ago, there is no release containing it yet, if you want to use it already, you can add a @dev flag in genemu form bundle constraint in your composer.json.

klb-rodriguez commented 11 years ago

thanks for help @bamarni, I did that you tell me, but the error still persists, this is my configuration in composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.3.*",
        "jms/security-extra-bundle": "1.5.*",
        "jms/di-extra-bundle": "1.4.*",
        "friendsofsymfony/user-bundle": "*",
        "sonata-project/cache-bundle": "dev-master",
        "sonata-project/block-bundle": "2.*@dev",
        "sonata-project/jquery-bundle": "1.8.*",
        "knplabs/knp-menu-bundle": "1.1.*@dev",
        "sonata-project/exporter": "1.*",
        "sonata-project/admin-bundle": "dev-master",
        "sonata-project/doctrine-orm-admin-bundle": "dev-master",
        "sonata-project/intl-bundle": "dev-master",
        "sonata-project/easy-extends-bundle": "*",
        "sonata-project/user-bundle": "dev-master",
        "friendsofsymfony/jsrouting-bundle": "~1.1",
        "genemu/form-bundle": "2.1.*@dev"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        },
        "symfony-assets-install": "symlink"
    }
}

My config file

#GenemuFormBundle
genemu_form:
    select2:
        enabled: true
        configs:
            placeholder: Select a value
            width: off
            allowClear: false
            minimumInputLength: 0

and this is the error message: image

bamarni commented 11 years ago

it's only in genemu 2.2.x versions, you'll get it when upgrading to symfony 2.3

klb-rodriguez commented 11 years ago

Thanks for help @bamarni I upgraded symfony to 2.3 version and it worked.

ladro1987 commented 11 years ago

Hi all, i tried the solution above with Symfony 2.3 but i got always the same error. I'm so frustrated :(

Then, this is my composer.json

{

    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },

    "repositories": [
    {
        "type": "package",
        "package": {
            "name": "jquery/jquery",
            "version": "1.9.1",
            "dist": {
                "url": "http://code.jquery.com/jquery-1.9.1.js",
                "type": "file"
            }
        }
    }],

    "require": {

        "php": ">=5.3.3",
        "symfony/symfony": "2.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",

        "braincrafted/bootstrap-bundle": "dev-master",
        "twitter/bootstrap": "2.3.*",
        "jquery/jquery": "1.9.*",
        "leafo/lessphp": "dev-master",
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "doctrine/data-fixtures" : "dev-master",
        "doctrine/doctrine-migrations-bundle": "dev-master",
        "doctrine/migrations": "dev-master",
        "genemu/form-bundle": "2.2.*"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
                    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
            ]
        },
    "config": {
            "bin-dir": "bin"
        },
        "minimum-stability": "stable",
        "extra": {
            "symfony-app-dir": "app",
             "symfony-web-dir": "web",
            "incenteev-parameters": {
                    "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}

This is the snipped of my select into the form:

->add('preferred_language', 'genemu_jqueryselect2_entity', array(
    'mapped' => false,
    'class' => 'Common\MainBundle\Entity\Language',
    'property' => 'name',
    'empty_data'  => 'Select a preferred language'
))

This is the snippet of my conf.yml file:

genemu_form:
    select2:
        enabled: true
    configs:
        placeholder: 'Select a value'
        width: off
        allowClear: false   
        minimumInputLength: 0

I got always the same error! How it's possible? :(

bamarni commented 11 years ago

@ladro1987 : it will be on the next release, for the moment you can do the following : "genemu/form-bundle": "2.2.*@dev"

ladro1987 commented 11 years ago

Thanks a lot. now i have no errors. :)

The select, however, is still "not customised", why?