// Fix #PSCFV-4789
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17801 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1405,9 +1405,14 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
if (!Image::getCover($image->id_product))
|
if (!Image::getCover($image->id_product))
|
||||||
{
|
{
|
||||||
$res &= Db::getInstance()->execute('
|
$res &= Db::getInstance()->execute('
|
||||||
UPDATE `'._DB_PREFIX_.'image`
|
UPDATE `'._DB_PREFIX_.'image_shop` image_shop
|
||||||
SET `cover` = 1
|
SET image_shop.`cover` = 1
|
||||||
WHERE `id_product` = '.(int)$image->id_product.'
|
WHERE image_shop.`id_image` = (SELECT id_image FROM
|
||||||
|
(SELECT image_shop.id_image
|
||||||
|
FROM '._DB_PREFIX_.'image i'.
|
||||||
|
Shop::addSqlAssociation('image', 'i').'
|
||||||
|
WHERE i.id_product ='.(int)$image->id_product.' LIMIT 1
|
||||||
|
) tmpImage)
|
||||||
AND id_shop='.(int)$this->context->shop->id.'
|
AND id_shop='.(int)$this->context->shop->id.'
|
||||||
LIMIT 1');
|
LIMIT 1');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user