EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
4.06k stars 1.02k forks source link

Call to a member function getMetadataFactory() on a non-object #1055

Closed grekpg closed 8 years ago

grekpg commented 8 years ago

I try install EasyAdmin in large symfony app and get error:

Fatal error: Call to a member function getMetadataFactory() on a non-object in 
/home/grek/PhpstormProjects/mea.crm4/vendor/javiereguiluz/easyadmin-
bundle/Configuration/MetadataConfigPass.php on line 37

I setup test easy config

easy_admin:
    site_name: 'test'
    design:
      color_scheme: 'light'
      menu:
          - 'MeetSailRoute'
    formats:
            date:     'Y-m-d'
            time:     'H:i'
            datetime: 'Y-m-d H:i:s'
    entities:
        MeetSailRoute:
          class: Mea\MountMeetBundle\Entity\MeetSailRoute
          list:
            fields:
              - 'name'
          form:
            fields:
              - 'name'

doctrine:
    dbal:
        driver:    pdo_mysql
        dbname:   %database_name%
        host:   %database_host%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: %kernel.root_dir%/data/data.db3
        # path:     %database_path%

    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true
        dql:
            string_functions:
                group_concat:   DoctrineExtensions\Query\Mysql\GroupConcat
                week: DoctrineExtensions\Query\Mysql\Week`

here is composer.json

"require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.8.*",
        "doctrine/orm": "~2.2,>=2.2.3,<2.5",
        "doctrine/dbal": "<2.5",
        "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,>=3.0.12",
        "sensio/framework-extra-bundle": "~3.0,>=3.0.2",
        "javiereguiluz/easyadmin-bundle": "^1.11",
      "friendsofsymfony/user-bundle": "~2.0@dev",
      "friendsofsymfony/comment-bundle": "^2.0",
        "stof/doctrine-extensions-bundle": "~1.1@dev",
        "zetacomponents/mail": "dev-master",
        "html2text/html2text": "dev-master",
        "weotch/phpthumb": "dev-master",
        "hashids/hashids": "0.3.*@dev",
        "egeloen/google-map-bundle": "*",
        "oh/google-map-form-type-bundle": "dev-master",
        "meenie/javascript-packer": "dev-master",
        "natxet/CssMin": "dev-master",
        "friendsofsymfony/jsrouting-bundle": "~1.5",
        "white-october/pagerfanta-bundle": "~1.0",
        "payum/payum-bundle": "0.14.*",
        "payum/paypal-express-checkout-nvp": "*@stable",
        "payum/offline": "0.14.*",
        "egeloen/ckeditor-bundle": "2.2.*@dev",
        "webit/sms-common": "dev-master",
        "webit/smsapi": "dev-master",
        "webit/smsapi-bundle": "dev-master",
        "ddeboer/data-import": "@stable",
        "endroid/qrcode": "1.*@dev",
        "vich/uploader-bundle": "0.14.*",
        "knplabs/knp-gaufrette-bundle": "*@dev",
        "incenteev/composer-parameter-handler": "~2.0",
        "salavert/time-ago-in-words": "1.*",
        "astina/social-links-bundle":"dev-master",
        "liip/imagine-bundle": "~1.2",
        "symfony/proxy-manager-bridge": "~2.3",
        "fpn/tag-bundle": "0.9.*",
        "bomo/ical-bundle": "1.0.*",
        "snc/redis-bundle": "~1.1",
        "predis/predis": "^1.0",
        "bgaluszka/mbank": "dev-master",
        "knplabs/knp-snappy-bundle": "^1.2",
        "jms/serializer-bundle": "^1.1",
        "friendsofsymfony/rest-bundle": "^1.7",
        "educoder/pest": "1.0.0",
        "friendsofsymfony/elastica-bundle": "^3.1",
        "symfony/var-dumper": "^2.7",
        "phpoffice/phpexcel": "^1.8",
        "apy/datagrid-bundle": "2.2.x-dev",
        "beberlei/DoctrineExtensions": "^1.0"
xabbuh commented 8 years ago

Are you sure that the Mea\MountMeetBundle\Entity\MeetSailRoute class does exist and is a mapped entity?

xabbuh commented 8 years ago

@javiereguiluz I think the MetadataConfigPass should check if the configured class names are actually managed entities and throw meaningful exceptions otherwise.

javiereguiluz commented 8 years ago

@grekpg as @xabbuh said, this is probably because that entity doesn't exist (at least not with that namespace). In any case, even if this is true, I think we need to improve this to output a meaningful error message.

javiereguiluz commented 8 years ago

@xabbuh yes :grin:

grekpg commented 8 years ago

yes sory - i just start this entity and dont put @ORM\Entity sory for question.

javiereguiluz commented 8 years ago

@grekpg on the contrary. No need to say sorry. Thanks to you we'll improve this bundle for all users. Thank you!