From 74680ac269a2225e55fe26070a3bdd0e776758da Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Thu, 24 May 2018 13:18:19 +0200 Subject: [PATCH] Only set locales on entities managed by knp translations --- src/ORM/Translatable/TranslatableSubscriber.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ORM/Translatable/TranslatableSubscriber.php b/src/ORM/Translatable/TranslatableSubscriber.php index 18a5af12..dc92c600 100644 --- a/src/ORM/Translatable/TranslatableSubscriber.php +++ b/src/ORM/Translatable/TranslatableSubscriber.php @@ -316,7 +316,7 @@ private function setLocales(LifecycleEventArgs $eventArgs) $entity = $eventArgs->getEntity(); $classMetadata = $em->getClassMetadata(get_class($entity)); - if (!$this->getClassAnalyzer()->hasMethod($classMetadata->reflClass, 'setCurrentLocale')) { + if (!$this->isTranslatable($classMetadata)) { return; }