sonata bundle中的symfony 2.8 page_bundle错误

时间:2017-08-07 10:33:51

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

执行此命令时,创建的站点正常运行 php app/console sonata:page:create-site 但是当我使用图形界面创建它时,它会向我显示此错误

  

警告:get_class()期望参数1为对象,给定整数

堆栈跟踪 在vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php at line 58 -

 */
public static function getClass($object)
{
    return self::getRealClass(get_class($object));
}
/**

完整堆栈跟踪:

Stack Trace
in vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php at line 59   -
     */
    public static function getClass($object)
    {
        return self::getRealClass(get_class($object));
    }
    /**
at ErrorHandler ->handleError ('2', 'get_class() expects parameter 1 to be object, integer given', '/var/www/html/socle_symfony2/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php', '59', array('object' => '0')) 
at get_class ('0') 
in vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php at line 59   + 
at ClassUtils ::getClass ('0') 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 165   + 
at ModelChoiceLoader ->getIdentifierValues ('0') 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 113   + 
at ModelChoiceLoader ->loadChoiceList (null) 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 152   + 
at ModelChoiceLoader ->loadValuesForChoices (array(null), null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php at line 134   + 
at LazyChoiceList ->getValuesForChoices (array(null)) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php at line 37   + 
at ChoiceToValueTransformer ->transform (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 1146   + 
at Form ->normToView (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 353   + 
at Form ->setData (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 59   + 
at PropertyPathMapper ->mapDataToForms (null, object(RecursiveIteratorIterator)) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 386   + 
at Form ->setData (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 478   + 
at Form ->initialize () 
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 226   + 
at FormBuilder ->getForm () 
in app/cache/dev/classes.php at line 8818   + 
at AbstractAdmin ->buildForm () 
in app/cache/dev/classes.php at line 7852   + 
at AbstractAdmin ->getForm () 
in vendor/sonata-project/admin-bundle/Controller/CRUDController.php at line 499   + 
at CRUDController ->createAction () 
in vendor/sonata-project/page-bundle/Controller/PageAdminController.php at line 138   + 
at PageAdminController ->createAction (object(Request)) 
at call_user_func_array (array(object(PageAdminController), 'createAction'), array(object(Request))) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 144   + 
at HttpKernel ->handleRaw (object(Request), '1') 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 64   + 
at HttpKernel ->handle (object(Request), '1', true) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php at line 69   + 
at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php at line 185   + 
at Kernel ->handle (object(Request)) 
in web/app_dev.php at line 28   + 
at require ('/var/www/html/socle_symfony2/web/app_dev.php') 
in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router_dev.php at line 40   + 
Stack Trace
in vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php at line 59   -
     */
    public static function getClass($object)
    {
        return self::getRealClass(get_class($object));
    }
    /**
at ErrorHandler ->handleError ('2', 'get_class() expects parameter 1 to be object, integer given', '/var/www/html/socle_symfony2/vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php', '59', array('object' => '0')) 
at get_class ('0') 
in vendor/doctrine/common/lib/Doctrine/Common/Util/ClassUtils.php at line 59   + 
at ClassUtils ::getClass ('0') 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 165   + 
at ModelChoiceLoader ->getIdentifierValues ('0') 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 113   + 
at ModelChoiceLoader ->loadChoiceList (null) 
in vendor/sonata-project/admin-bundle/Form/ChoiceList/ModelChoiceLoader.php at line 152   + 
at ModelChoiceLoader ->loadValuesForChoices (array(null), null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php at line 134   + 
at LazyChoiceList ->getValuesForChoices (array(null)) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php at line 37   + 
at ChoiceToValueTransformer ->transform (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 1146   + 
at Form ->normToView (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 353   + 
at Form ->setData (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php at line 59   + 
at PropertyPathMapper ->mapDataToForms (null, object(RecursiveIteratorIterator)) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 386   + 
at Form ->setData (null) 
in vendor/symfony/symfony/src/Symfony/Component/Form/Form.php at line 478   + 
at Form ->initialize () 
in vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php at line 226   + 
at FormBuilder ->getForm () 
in app/cache/dev/classes.php at line 8818   + 
at AbstractAdmin ->buildForm () 
in app/cache/dev/classes.php at line 7852   + 
at AbstractAdmin ->getForm () 
in vendor/sonata-project/admin-bundle/Controller/CRUDController.php at line 499   + 
at CRUDController ->createAction () 
in vendor/sonata-project/page-bundle/Controller/PageAdminController.php at line 138   + 
at PageAdminController ->createAction (object(Request)) 
at call_user_func_array (array(object(PageAdminController), 'createAction'), array(object(Request))) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 144   + 
at HttpKernel ->handleRaw (object(Request), '1') 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php at line 64   + 
at HttpKernel ->handle (object(Request), '1', true) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php at line 69   + 
at ContainerAwareHttpKernel ->handle (object(Request), '1', true) 
in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php at line 185   + 
at Kernel ->handle (object(Request)) 
in web/app_dev.php at line 28   + 
at require ('/var/www/html/socle_symfony2/web/app_dev.php') 
in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/router_dev.php at line 40   + 
{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/" },
        "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
    },
    "require": {
        "php": ">=5.3.9",
        "symfony/symfony": "2.8.18",
        "doctrine/orm": "2.5.6",
        "doctrine/doctrine-bundle": "1.6.7",
        "symfony/swiftmailer-bundle": "2.5.4",
        "symfony/monolog-bundle": "3.1.0",
        "sensio/distribution-bundle": "5.0.18",
        "sensio/framework-extra-bundle": "3.0.25",
        "incenteev/composer-parameter-handler": "2.1.2",
        "doctrine/doctrine-fixtures-bundle": "2.3.0",
        "sonata-project/admin-bundle": "^3.2",
        "sonata-project/doctrine-orm-admin-bundle": "^3.1",
        "sonata-project/easy-extends-bundle": "^2.2",
        "sonata-project/user-bundle": "3.2.3",
        "zircote/swagger-php": "2.0.8",
        "phpunit/phpunit": "4.8.35",
        "fr3d/swagger-assertions": "0.6.0",
        "friendsofsymfony/rest-bundle": "^2.1",
        "jms/serializer": "1.6.2",
        "sonata-project/media-bundle": "3.5.0",
        "sonata-project/classification-bundle": "3.3.0",
        "imagine/imagine":"0.6.3",
        "sonata-project/translation-bundle": "2.0.1",
        "stof/doctrine-extensions-bundle": "1.2.2",
        "sonata-project/intl-bundle": "2.3.0",
        "symfony/assetic-bundle": "2.8.1",
        "friendsofsymfony/oauth-server-bundle": "1.5.2",
        "simplethings/entity-audit-bundle": "1.0.4",
        "knplabs/knp-paginator-bundle": "2.5.4",
        "jmose/command-scheduler-bundle": "1.2.5",
        "nelmio/cors-bundle": "1.5.3",
        "knplabs/knp-snappy-bundle": "dev-master",
        "h4cc/wkhtmltopdf-amd64": "0.12.2.1",

        "cocur/slugify": "1.4.1",
        "sonata-project/block-bundle": "^2.2",
        "sonata-project/cache": "^1.0.2",
        "sonata-project/cache-bundle": "^2.1.7",
        "sonata-project/core-bundle": "^3.0",
        "sonata-project/datagrid-bundle": "^2.2",
        "sonata-project/doctrine-extensions": "^1.0",
        "sonata-project/notification-bundle": "^3.0",

        "liip/monitor-bundle": "^2.5",
        "nelmio/api-doc-bundle": "dev-master",
        "symfony/config": "^2.3.9",
        "symfony/console": "^2.3",
        "symfony/debug": "^2.3",
        "symfony/dependency-injection": "^2.3.3",
        "symfony/form": "^2.3.5",
        "symfony/http-foundation": "^2.3",
        "symfony/http-kernel": "^2.3",
        "symfony/options-resolver": "^2.3",
        "symfony/process": "^2.3.5",
        "symfony/routing": "^2.3",
        "symfony/security": "^2.3",
        "symfony/templating": "^2.3",
        "symfony/validator": "^2.3",
        "symfony-cmf/routing-bundle": "^1.1",
        "sonata-project/seo-bundle": "^2.2",
        "sonata-project/page-bundle": "^3.5",
        "sonata/formatter-bundle": "^3.0.1"
    },
    "require-dev": {
        "sensio/generator-bundle": "3.1.4",
        "symfony/phpunit-bridge": "2.8.19",
        "timeinc/swagger-bundle": "0.2.0",
        "liip/functional-test-bundle": "^1.6"
    },
    "scripts": {
        "symfony-scripts": [
            "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",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "config": {
        "bin-dir": "bin",
        "platform": {
            "php": "5.5.9"
        }
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.8-dev"
        }
    }
}

编辑:格式化代码以获得更好的可见性。如果你下次能描述一下,那将是很有帮助的。

0 个答案:

没有答案