dps69208 2017-10-21 15:34
浏览 70
已采纳

SuluArticleBundle抛出未定义的索引:文章

I'm trying to setup the SuluArticleBundle with ElasticSearch 2.4. I'm following the documentation but I keep getting

[Symfony\Component\Debug\Exception\ContextErrorException] Notice: Undefined index: article

when running the php bin/console assets:installcommand

This is the first time I'm using ElasticSearch and the SuluArticleBundle so I'm not sure if it's an error related to my ElasticSearch setup or the bundle setup.

Any idea what the problem might be?

Edit

This is the stack trace

Exception trace: () at /Users/jaimy/projects/student-starter/vendor/sulu/article-bundle/DependencyInjection/SuluArticleExtension.php:253 Sulu\Bundle\ArticleBundle\DependencyInjection\SuluArticleExtension->appendArticlePageConfig() at /Users/jaimy/projects/student-starter/vendor/sulu/article-bundle/DependencyInjection/SuluArticleExtension.php:207 Sulu\Bundle\ArticleBundle\DependencyInjection\SuluArticleExtension->load() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php:66 Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass->process() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/MergeExtensionConfigurationPass.php:39 Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass->process() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/Compiler.php:143 Symfony\Component\DependencyInjection\Compiler\Compiler->compile() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:746 Symfony\Component\DependencyInjection\ContainerBuilder->compile() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:576 Symfony\Component\HttpKernel\Kernel->initializeContainer() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:118 Symfony\Component\HttpKernel\Kernel->boot() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:65 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /Users/jaimy/projects/student-starter/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:125 Symfony\Component\Console\Application->run() at /Users/jaimy/projects/student-starter/bin/console.php:23 include() at /Users/jaimy/projects/student-starter/bin/console:21 Edit #2

This is my sulu_core config

# SuluCore Configuration
sulu_core:
    webspace:
        config_dir: "%kernel.root_dir%/Resources/webspaces"
    content:
        structure:
            default_type:
                snippet: "article_default"
            paths:
                homepage:
                    path: "%kernel.root_dir%/Resources/templates/pages"
                    type: "home"
                page:
                    path: "%kernel.root_dir%/Resources/templates/pages"
                    type: "page"
                snippet:
                    path: "%kernel.root_dir%/Resources/templates/snippets"
                    type: "snippet"
                article:
                    path: "%kernel.root_dir%/Resources/templates/articles"
                    type: "article"
  • 写回答

1条回答 默认 最新

  • dongzhou1865 2017-10-24 18:41
    关注

    I think you missed the default_type configuration for the article. please add the config at sulu_core.content.structure.default_type.article.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境