2

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"
Jaimy
  • 517
  • 4
  • 20
  • Can you call the command with the `-v` flag and post the stack trace? Then i can see which line causes the issue! Did you use the newest version of SuluArticleBundle? – Johannes Wachter Oct 23 '17 at 05:57
  • Have you also configured the `sulu_core` with the new pathes? see: https://github.com/sulu/SuluArticleBundle/blob/master/Resources/doc/installation.md#configure-suluarticlebundle-and-sulu-core – Johannes Wachter Oct 23 '17 at 05:58
  • I've added the stack trace to the question. Yeah I'm using the latest version of the ArticleBundle. I've not yet configured the `sulu_core`. Might that solve my problem? I haven't done that yet because I'm walking through the install docs in order. – Jaimy Oct 23 '17 at 17:53
  • i think that would solve the issue - maybe the docs could be improve in that point – Johannes Wachter Oct 23 '17 at 18:05
  • I'm so sorry, I was looking at competely the wrong branch of my project. I did in fact configure the `sulu_core`. Exactly like described in the docs. – Jaimy Oct 23 '17 at 18:19
  • so you have configured it correctly? – Johannes Wachter Oct 23 '17 at 18:22
  • Yes I have the exact same configuration as in the docs. – Jaimy Oct 23 '17 at 18:28
  • can you also post you configuration of `sulu_core`? do you have multiple `sulu_core` sections in a single config.yml file? – Johannes Wachter Oct 24 '17 at 06:15
  • Ah yes I now see that I have multiple `sulu_core` sections in my config file. I'll merge them and let you know how that works out. If the error still occurs, I'll post my config. – Jaimy Oct 24 '17 at 16:33
  • Still get the error so I've posted my config. – Jaimy Oct 24 '17 at 16:36
  • is this configuration in the file app/config/config.yml? could you please correct the indemtation? – Johannes Wachter Oct 24 '17 at 16:41
  • I hope this is better? This is the way I have it setup in my app/config/config.yml. – Jaimy Oct 24 '17 at 17:05

1 Answers1

3

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

  • Thanks a lot for your time and help! That was the problem. Stupid mistake. Thanks again! – Jaimy Oct 24 '17 at 19:21