diff --git a/Document/Index/ArticleIndexer.php b/Document/Index/ArticleIndexer.php index e9940973..fa201bc3 100644 --- a/Document/Index/ArticleIndexer.php +++ b/Document/Index/ArticleIndexer.php @@ -429,9 +429,15 @@ public function remove(ArticleDocument $document/*, ?string $locale = null*/): v } } + /** + * @deprecated + * @see ArticleIndexer::replaceWithGhostData + */ public function removeLocale(ArticleDocument $document, string $locale): void { - $this->remove($document, $locale); + @\trigger_error('Calling ArticleIndexer::removeLocale() is deprecated and will be removed in future. Use ArticleIndexer::replaceWithGhostData() instead.', \E_USER_DEPRECATED); + + $this->replaceWithGhostData($document, $locale); } public function replaceWithGhostData(ArticleDocument $document, string $locale): void diff --git a/Document/Subscriber/ArticleSubscriber.php b/Document/Subscriber/ArticleSubscriber.php index fcc535f7..1aec28ab 100644 --- a/Document/Subscriber/ArticleSubscriber.php +++ b/Document/Subscriber/ArticleSubscriber.php @@ -495,7 +495,7 @@ public function handleRemoveLocaleLive(RemoveLocaleEvent $event) return; } - $this->liveIndexer->removeLocale($document, $event->getLocale()); + $this->liveIndexer->remove($document, $event->getLocale()); $this->liveIndexer->flush(); }