From 69aa00f7abbd4d51b0bd68bcbbbe7a02b016cabe Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Tue, 2 Feb 2016 09:52:33 +0100 Subject: [PATCH] Fixed #1961 --- core/lib/Thelia/Action/Product.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Action/Product.php b/core/lib/Thelia/Action/Product.php index 0c34929f0a..aa280024d8 100644 --- a/core/lib/Thelia/Action/Product.php +++ b/core/lib/Thelia/Action/Product.php @@ -117,8 +117,14 @@ public function cloneProduct(ProductCloneEvent $event) $originalProduct = $event->getOriginalProduct(); $dispatcher = $event->getDispatcher(); - $originalProductDefaultI18n = ProductI18nQuery::create() - ->findPk([$originalProduct->getId(), $lang]); + if (null === $originalProductDefaultI18n = ProductI18nQuery::create() + ->findPk([$originalProduct->getId(), $lang])) { + // No i18n entry for the current language. Try to find one for creating the product. + // It will be updated later by updateClone() + $originalProductDefaultI18n = ProductI18nQuery::create() + ->findOneById($originalProduct->getId()) + ; + } $originalProductDefaultPrice = ProductPriceQuery::create() ->findOneByProductSaleElementsId($originalProduct->getDefaultSaleElements()->getId());