sulu / SuluArticleBundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system
MIT License
52 stars 77 forks source link

Fix namespaces in documentation about extending view document #577

Closed niklasnatter closed 3 years ago

niklasnatter commented 3 years ago

Without these changes, I encounter the following error when following the documentation:

Symfony\Component\ErrorHandler\Error\FatalError {#12488
  -error: array:4 [
    "type" => 64
    "message" => "Cannot declare class AppBundle\Document\ArticleViewDocument, because the name is already in use"
    "file" => "/Users/niklas/Development/projects/sulu-demo/src/Document/ArticleViewDocument.php"
    "line" => 12
  ]
  #message: "Compile Error: Cannot declare class AppBundle\Document\ArticleViewDocument, because the name is already in use"
  #code: 0
  #file: "./src/Document/ArticleViewDocument.php"
  #line: 12
  trace: {
    ./src/Document/ArticleViewDocument.php:12 {
      ›  */
      › class ArticleViewDocument extends SuluArticleViewDocument
      › {
    }
    ./vendor/composer/ClassLoader.php:478 { …}
    ./vendor/composer/ClassLoader.php:346 { …}
    ./vendor/symfony/error-handler/DebugClassLoader.php:351 { …}
    ./vendor/handcraftedinthealps/elasticsearch-bundle/Mapping/MetadataCollector.php:145 { …}
    ./vendor/handcraftedinthealps/elasticsearch-bundle/Mapping/MetadataCollector.php:145 { …}
    ./vendor/handcraftedinthealps/elasticsearch-bundle/Mapping/MetadataCollector.php:145 { …}
    ./vendor/handcraftedinthealps/elasticsearch-bundle/Mapping/MetadataCollector.php:80 { …}
    ./vendor/handcraftedinthealps/elasticsearch-bundle/DependencyInjection/Compiler/RepositoryPass.php:35 { …}
    ./vendor/symfony/dependency-injection/Compiler/Compiler.php:91 { …}
    ./vendor/symfony/dependency-injection/ContainerBuilder.php:736 { …}
    ./vendor/symfony/http-kernel/Kernel.php:541 { …}
    ./vendor/symfony/http-kernel/Kernel.php:780 { …}
    ./vendor/symfony/http-kernel/Kernel.php:121 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:168 { …}
    ./vendor/symfony/framework-bundle/Console/Application.php:74 { …}
    ./vendor/symfony/console/Application.php:166 { …}
    ./bin/console.php:51 { …}
    ./bin/adminconsole:7 { …}
    ./bin/adminconsole:0 { …}
  }
}

Also this should fix https://github.com/sulu/SuluArticleBundle/issues/563