doujing5726 2017-09-13 15:08 采纳率: 0%
浏览 94

找不到属性Application \ Sonata \ NewsBundle \ Entity \ Post :: $ tags的元数据。 请确保您的Doctrine映射已正确配置

I installed SonataNews Bundle and Extended it as ApplicationSonataNewsBundle.

When I go to /app_dev.php/admin/sonata/news/post/list

I have the issue message

No metadata found for property Application\Sonata\NewsBundle\Entity\Post::$tags. Please make sure your Doctrine mapping is properly configured.
500 Internal Server Error - MissingPropertyMetadataException

Someone could help me?

Environment

Symfony 2.8

  sonata-project/admin-bundle 3.23.0 The missing Symfony Admin
    Generator sonata-project/block-bundle 3.3.2 Symfony
    SonataBlockBundle sonata-project/cache 1.0.7 Cache library
    sonata-project/cache-bundle 2.3.1 This bundle provides caching
    services sonata-project/classification-bundle 3.3.1 Symfony
    SonataClassificationBundle sonata-project/core-bundle 3.4.0 Symfony
    SonataCoreBundle sonata-project/datagrid-bundle 2.2.1 Symfony
    SonataDatagridBundle sonata-project/doctrine-extensions 1.0.2
    Doctrine2 behavioral extensions
    sonata-project/doctrine-orm-admin-bundle 3.1.6 Symfony Sonata /
    Integrate Doctrine ORM into the SonataAdminBundle
    sonata-project/easy-extends-bundle 2.2.0 Symfony
    SonataEasyExtendsBundle sonata-project/exporter 1.7.1 Lightweight
    Exporter library sonata-project/formatter-bundle 3.2.2 Symfony
    SonataFormatterBundle sonata-project/google-authenticator 1.1.0
    Library to integrate Google Authenticator into a PHP project
    sonata-project/intl-bundle 2.3.1 Symfony SonataIntlBundle
    sonata-project/media-bundle 3.6.0 Symfony SonataMediaBundle
    sonata-project/news-bundle 3.1.2 Symfony SonataNewsBundle
    sonata-project/notification-bundle 3.1.0 Symfony
    SonataNotificationBundle sonata-project/page-bundle 3.5.1 This
    bundle provides a Site and Page management through container and
    block services sonata-project/seo-bundle 2.2.0 Symfony
    SonataSeoBundle sonata-project/translation-bundle 2.1.1
    SonataTranslationBundle sonata-project/user-bundle 3.2.4 Symfony
    SonataUserBundle

Symfony packages

symfony/assetic-bundle v2.8.2 Integrates Assetic into Symfony2
symfony/monolog-bundle v3.1.0 Symfony MonologBundle
symfony/phpunit-bridge v2.8.27 Symfony PHPUnit Bridge
symfony/polyfill-apcu v1.5.0 Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu v1.5.0 Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring v1.5.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php54 v1.5.0 Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55 v1.5.0 Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56 v1.5.0 Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70 v1.5.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util v1.5.0 Symfony utilities for portability of PHP codes
symfony/security-acl v2.8.0 Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.6.3 Symfony SwiftmailerBundle
symfony/symfony v2.8.27 The Symfony PHP framework

PHP version

PHP 7.0.19
  • 写回答

2条回答 默认 最新

  • duan0504 2018-09-25 09:32
    关注

    I had similar issue, on my case this was due to class configuration. Mapping is injected during Sf DI, but my custom User Class was not found.

    Just check classes used by the News Bundle.

    sonata_news:
        class:
            post:       Application\Sonata\NewsBundle\Entity\Post
            comment:    Application\Sonata\NewsBundle\Entity\Comment
            media:      Application\Sonata\MediaBundle\Entity\Media
            user:       My\Custom\UserBundle\Entity\User
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算