From 8a0474320ff072abd950ae15be16d9c0362f9db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Wed, 27 Feb 2013 16:16:02 +0100 Subject: [PATCH] [-] Core: Fix #PSCFV-8012 attribute_url is sometimes null but also sometimes empty... --- classes/Product.php | 8 ++++---- controllers/admin/AdminModulesController.php | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index d0e1f61a5..fbd4e7845 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4736,7 +4736,7 @@ class ProductCore extends ObjectModel '.Shop::addSqlAssociation('product_attribute', 'pa').' LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)Context::getContext()->language->id.') - WHERE la.`url_name` IS NOT NULL + WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\' AND pa.`id_product` = '.(int)$id_product); if (!empty($nb_custom_values)) @@ -4753,7 +4753,7 @@ class ProductCore extends ObjectModel ON (a.`id_attribute_group` = g.`id_attribute_group`) WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].' AND g.`id_lang` = '.(int)Context::getContext()->language->id.' - AND g.`url_name` IS NOT NULL'); + AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\''); if (empty($group)) { $group = Db::getInstance()->executeS(' @@ -4842,7 +4842,7 @@ class ProductCore extends ObjectModel '.Shop::addSqlAssociation('product_attribute', 'pa').' LEFT JOIN `'._DB_PREFIX_.'layered_indexable_attribute_lang_value` la ON (la.`id_attribute` = a.`id_attribute` AND la.`id_lang` = '.(int)Context::getContext()->language->id.') - WHERE la.`url_name` IS NOT NULL + WHERE la.`url_name` IS NOT NULL AND la.`url_name` != \'\' AND pa.`id_product` = '.(int)$id_product); if (!empty($nb_custom_values)) @@ -4859,7 +4859,7 @@ class ProductCore extends ObjectModel ON (a.`id_attribute_group` = g.`id_attribute_group`) WHERE a.`id_attribute` = '.(int)$attribute['id_attribute'].' AND g.`id_lang` = '.(int)Context::getContext()->language->id.' - AND g.`url_name` IS NOT NULL'); + AND g.`url_name` IS NOT NULL AND g.`url_name` != \'\''); if (empty($group)) { $group = Db::getInstance()->executeS(' diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 43bdfef4e..50c848784 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -220,6 +220,7 @@ class AdminModulesControllerCore extends AdminController { $this->context->cookie->username_addons = ''; $this->context->cookie->password_addons = ''; + $this->context->cookie->write(); die('OK'); }