SuluArticleBundle 抛出未定义的索引:文章
SuluArticleBundle throws undefined index: article
我正在尝试使用 ElasticSearch 2.4 设置 SuluArticleBundle。我正在关注 documentation 但我一直在关注
[Symfony\Component\Debug\Exception\ContextErrorException]
Notice: Undefined index: article
当 运行 php bin/console assets:install
命令时
这是我第一次使用 ElasticSearch 和 SuluArticleBundle,所以我不确定这是与我的 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"
我认为您错过了文章的 default_type 配置。请在 sulu_core.content.structure.default_type.article
添加配置。
我正在尝试使用 ElasticSearch 2.4 设置 SuluArticleBundle。我正在关注 documentation 但我一直在关注
[Symfony\Component\Debug\Exception\ContextErrorException]
Notice: Undefined index: article
当 运行 php bin/console assets:install
命令时
这是我第一次使用 ElasticSearch 和 SuluArticleBundle,所以我不确定这是与我的 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"
我认为您错过了文章的 default_type 配置。请在 sulu_core.content.structure.default_type.article
添加配置。