Content-Length: 269520 | pFad | http://github.com/sulu/SuluArticleBundle/commit/e2580046d0b8383ddc710e20f3d449a2d4a20477

1E Remove default type fallback in compilerpass (#513) · sulu/SuluArticleBundle@e258004 · GitHub
Skip to content

Commit

Permalink
Remove default type fallback in compilerpass (#513)
Browse files Browse the repository at this point in the history
* Remove default type fallback in compilerpass

* Update sulu/sulu requirement version

Co-authored-by: Niklas Natter <niklas@sulu.io>
  • Loading branch information
alexander-schranz and niklasnatter authored Sep 17, 2020
1 parent 2fdda87 commit e258004
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 1 addition & 19 deletions DependencyInjection/StructureValidatorCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,14 @@ public function process(ContainerBuilder $container)
{
$types = ['article', 'article_page'];
$defaultTypes = $container->getParameter('sulu.content.structure.default_types');
$newDefaultTypes = $defaultTypes;
/** @var StructureMetadataFactory $structureFactory */
$structureFactory = $container->get('sulu_page.structure.factory');

foreach ($types as $type) {
$defaultType = $defaultTypes[$type] ?? null;

// this should be removed when is released https://github.com/sulu/sulu/pull/5381
// see https://github.com/sulu/SuluArticleBundle/pull/498 for more information
if (!$defaultType) {
$metadatas = $structureFactory->getStructures($type);

foreach ($metadatas as $metadata) {
$defaultType = $metadata->getName();

break;
}

unset($defaultTypes[$type]);
$container->setParameter('sulu.content.structure.default_types', $defaultTypes);
$newDefaultTypes[$type] = $defaultType;
continue;
}

try {
Expand All @@ -57,10 +44,5 @@ public function process(ContainerBuilder $container)
throw new DefaultArticleTypeNotFoundException($type, $defaultType, $exception);
}
}

// this should be removed when is released https://github.com/sulu/sulu/pull/5381
// see https://github.com/sulu/SuluArticleBundle/pull/498 for more information
$definition = $container->getDefinition('sulu_page.structure.factory');
$definition->setArgument(2, $newDefaultTypes);
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"handcraftedinthealps/elasticsearch-dsl": "^5.0.7.1 || ^6.2.0.1 || ^7.2.0.1",
"jms/serializer": "^3.3",
"jms/serializer-bundle": "^3.3",
"sulu/sulu": "^2.0.6",
"sulu/sulu": "^2.0.10",
"symfony/config": "^4.3",
"symfony/dependency-injection": "^4.3",
"symfony/http-foundation": "^4.3",
Expand Down

0 comments on commit e258004

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sulu/SuluArticleBundle/commit/e2580046d0b8383ddc710e20f3d449a2d4a20477

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy