Skip to content

Commit

Permalink
Fix export with ghost articles in different languages (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlagler committed Jul 6, 2022
1 parent 2a04d53 commit 3ed9bd8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions Controller/ArticleController.php
Expand Up @@ -334,10 +334,7 @@ function(FieldDescriptorInterface $fieldDescriptor) use ($fields) {
$result = [];
foreach ($searchResult as $document) {
$documentData = $this->normalize($document['_source'], $fieldDescriptors);

if ('ghost' == $documentData['localizationState']['state']) {
$documentData['ghostLocale'] = $documentData['localizationState']['locale'];
}
$documentData['ghostLocale'] = 'ghost' == $documentData['localizationState']['state'] ? $documentData['localizationState']['locale'] : null;

if (false !== ($index = array_search($documentData['id'], $ids))) {
$result[$index] = $documentData;
Expand Down
4 changes: 2 additions & 2 deletions Tests/Application/Kernel.php
Expand Up @@ -27,7 +27,7 @@ class Kernel extends SuluTestKernel implements CompilerPassInterface
/**
* {@inheritdoc}
*/
public function registerBundles()
public function registerBundles(): iterable
{
$bundles = parent::registerBundles();
$bundles[] = new SuluArticleBundle();
Expand Down Expand Up @@ -70,7 +70,7 @@ public function process(ContainerBuilder $container)
->setPublic(true);
}

protected function getKernelParameters()
protected function getKernelParameters(): array
{
$parameters = parent::getKernelParameters();

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Expand Up @@ -48,7 +48,9 @@
"sulu/automation-bundle": "^2.0@dev",
"symfony/browser-kit": "^4.3 || ^5.0",
"symfony/dotenv": "^4.3 || ^5.0",
"symfony/framework-bundle": "^4.3 || ^5.0",
"symfony/monolog-bundle": "^3.1",
"symfony/security-bundle": "^4.3 || ^5.0",
"symfony/stopwatch": "^4.3 || ^5.0",
"thecodingmachine/phpstan-strict-rules": "^0.12.0"
},
Expand Down

0 comments on commit 3ed9bd8

Please sign in to comment.