Skip to content

Commit

Permalink
index correct ghost content when deleting the locale of an article
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Dec 14, 2023
1 parent 8ccbbf7 commit 6c54d0e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Document/Subscriber/ArticleSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ public function handleRemoveLocale(RemoveLocaleEvent $event)
return;
}

$ghostLocale = $this->documentInspector->getConcreteLocales($document)[0] ?? null;
if (null !== $ghostLocale) {
$document = $this->documentManager->find($document->getUuid(), $ghostLocale);
}

$this->indexer->replaceWithGhostData($document, $event->getLocale());

Check failure on line 473 in Document/Subscriber/ArticleSubscriber.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Parameter #1 $document of method Sulu\Bundle\ArticleBundle\Document\Index\IndexerInterface::replaceWithGhostData() expects Sulu\Bundle\ArticleBundle\Document\ArticleDocument, object given.
$this->indexer->flush();
}
Expand Down

0 comments on commit 6c54d0e

Please sign in to comment.