2017-10-21 73 views
1

我試圖用ElasticSearch 2.4設置SuluArticleBundle。我正在關注的documentation但在運行php bin/console assets:install命令SuluArticleBundle拋出未定義索引:文章

這是我第一次使用ElasticSearch和SuluArticleBundle,所以我不知道這是否是一個時,我不斷收到

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

與我的ElasticSearch設置或軟件包設置有關的錯誤。

任何想法可能是什麼問題?

編輯

這是堆棧跟蹤

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 編輯#2

這是我sulu_core配置

# 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" 
+0

你能用'-v'標誌調用該命令併發布堆棧跟蹤嗎?然後我可以看到哪一行導致問題!你用過最新版本的SuluArticleBundle嗎? –

+0

你還配置了新的路徑'sulu_core'嗎?請參閱:https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/installation.md#configure-suluarticlebundle-and-sulu-core –

+0

我已將堆棧跟蹤添加到問題。是的,我使用的是最新版本的ArticleBundle。 我還沒有配置'sulu_core'。可能解決我的問題?我還沒有這樣做,因爲我正在按順序瀏覽安裝文檔。 – Jaimy

回答

1

我想你錯過的default_t的文章的ype配置。請在sulu_core.content.structure.default_type.article上添加配置。

+0

非常感謝您的時間和幫助!這是問題所在。愚蠢的錯誤。再次感謝! – Jaimy