SonataBlock,SonataAdmin和其他Sonata捆绑包一直显示“验证”错误

时间:2015-03-10 12:40:41

标签: php symfony sonata-admin sonata-user-bundle

编译错误:声明Sonata \ FormatterBundle \ Block \ FormatterBlockService :: validateBlock()必须与Sonata \ BlockBundle \ Block \ BlockAdminServiceInterface :: validateBlock兼容(Sonata \ CoreBundle \ Validator \ ErrorElement $ errorElement,Sonata \ BlockBundle \ Model \ BlockInterface $ block)

同时:

PHP致命错误:声明Sonata \ AdminBundle \ Block \ AdminListBlockService :: validateBlock()必须与Sonata \ BlockBundle \ Block \ BlockServiceInterface :: validateBlock兼容(Sonata \ AdminBundle \ Validator \ ErrorElement $ errorElement,Sonata \ BlockBundle \第105行的/phpProjects/vendor/sonata-project/admin-bundle/Block/AdminListBlockService.php中的Model \ BlockInterface $ block

这是我的composer.json

    "php": ">=5.4",
    "symfony/symfony": "2.6.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "~1.3@dev",
    "knplabs/knp-menu-bundle": "1.1.*@dev",
    "sonata-project/core-bundle": "~2.2@dev",
    "sonata-project/intl-bundle": "~2.2",
    "sonata-project/cache-bundle": "~2.2@dev",
    "sonata-project/easy-extends-bundle": "~2.1",
    "sonata-project/admin-bundle": "~2.3@dev",
    "sonata-project/doctrine-orm-admin-bundle": "~2.3@dev",
    "sonata-project/block-bundle": "~2.2",
    "sonata-project/exporter": "1.*",
    "sonata-project/user-bundle": "~2.3@dev",
    "sonata-project/formatter-bundle": "~2.3",
    "sonata-project/datagrid-bundle": "~2.2@dev",
    "sonata-project/media-bundle": "~2.3@dev",
    "jms/serializer-bundle": "~0.11",
    "jms/security-extra-bundle": "~1.5@dev",
    "jms/di-extra-bundle": "~1.4@dev",
    "jms/translation-bundle": "1.1.*@dev",
    "friendsofsymfony/jsrouting-bundle": "~1.1",
    "genemu/form-bundle": "2.2.*@dev",
    "wbx/file-bundle": "dev-master",

4 个答案:

答案 0 :(得分:1)

这里的问题相同。似乎“sonata-project / admin-bundle”中的某些内容已经发生了变化:过去2天内出现了“~2.3@dev”,现在它失败了(这个设置在2天前完成)。我回到奏鸣曲2.2正在工作。我建议在github上创建一个问题。

<小时/> 编辑: 今天我不得不将Sonata改为最新版本。此设置也有效:

"sonata-project/core-bundle": "dev-master",
"sonata-project/block-bundle": "dev-master",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/easy-extends-bundle": "dev-master",
"sonata-project/jquery-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",

答案 1 :(得分:1)

昨天我遇到了同样的问题,应该与昨天上午的更新有关,今天我已经改变了我的composer.json,这是我的工作配置:

"sonata-project/core-bundle": "2.3.*@dev",
"sonata-project/admin-bundle": "2.4.*@dev",
"sonata-project/user-bundle": "2.3.*@dev",
"sonata-project/doctrine-mongodb-admin-bundle": "2.3.*@dev",
"sonata-project/easy-extends-bundle": "2.1.*@dev",
"sonata-project/block-bundle": "2.3.*@dev",
"sonata-project/doctrine-orm-admin-bundle": "2.3.*@dev",
"sonata-project/cache-bundle": "~2.2@dev",
"sonata-project/seo-bundle": "2.0.*@dev",
"sonata-project/notification-bundle": "~2.3@dev",
"symfony-cmf/routing-bundle": "~1.4@dev",
"sonata-project/page-bundle": "2.4.*@dev",
"sonata-project/datagrid-bundle": "2.2.*@dev"

答案 2 :(得分:0)

最佳解决方案,添加依赖仅直接使用

我写到下面

    "friendsofsymfony/user-bundle": "~1.3",
    "sonata-project/user-bundle": "3.0.1",
    "sonata-project/cache-bundle": "~2.2@dev",
    "sonata-project/intl-bundle": "~2.2",
    "sonata-project/doctrine-orm-admin-bundle": "3.0.1",
    "sonata-project/doctrine-mongodb-admin-bundle": "3.0.0"

SonataAdminBundle是SonataUserBundle的依赖项。删除SonataAdminBundle并让SonataUserBundle安装捆绑包。其他人一样......

这是最好的解决方案。

答案 3 :(得分:0)

我也有同样的问题,这就是我解决它的方式。

    "php": "^5.3.9|^7.0",
    "symfony/symfony": "~2.8",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "doctrine/data-fixtures": "^1.1",
    "doctrine/doctrine-cache-bundle": "~1.0",
    "twig/extensions": "~1.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "symfony-cmf/symfony-cmf": "1.3.*",
    "symfony-cmf/simple-cms-bundle": "^1.3",
    "symfony-cmf/create-bundle": "1.2.*",
    "jackalope/jackalope-doctrine-dbal": "~1.1",
    "nelmio/alice": "~1.0",
    "symfony-cmf/routing-auto-bundle": "^1.1",
    "symfony/security-acl": "^3.0",
    "sonata-project/admin-bundle": "~2.3@dev",
    "sensio/generator-bundle": "~2.3",
    "sonata-project/doctrine-phpcr-admin-bundle": "^1.2.6",
    "symfony-cmf/menu-bundle": "^2.0"

目前,它正在发挥作用。