From 27978ed9a06edccd438417aa757c187edda2d27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 26 Aug 2018 07:47:33 +0200 Subject: [PATCH 1/2] Update productlot_list.php https://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/62492-dolibarr-8-erreur-sql-avec-le-menu-lots-series --- htdocs/product/stock/productlot_list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 874d5676e1f..4628c13d8e8 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -216,8 +216,7 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."product_lot as t"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot_extrafields as ef on (t.rowid = ef.fk_object)"; -$sql.= ", ".MAIN_DB_PREFIX."product as p"; -$sql.= " WHERE p.rowid = t.fk_product"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = t.fk_product"; $sql.= " WHERE p.entity IN (".getEntity('product').")"; if ($search_entity) $sql.= natural_search("entity",$search_entity); From e00d6eda7ee4a96c03e342278dc2809552096df5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Aug 2018 01:29:33 +0200 Subject: [PATCH 2/2] Update productlot_list.php --- htdocs/product/stock/productlot_list.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 4628c13d8e8..727e98bc0dc 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -216,8 +216,9 @@ $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // N $sql.=$hookmanager->resPrint; $sql.= " FROM ".MAIN_DB_PREFIX."product_lot as t"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lot_extrafields as ef on (t.rowid = ef.fk_object)"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = t.fk_product"; -$sql.= " WHERE p.entity IN (".getEntity('product').")"; +$sql.= ", ".MAIN_DB_PREFIX."product as p"; +$sql.= " WHERE p.rowid = t.fk_product"; +$sql.= " AND p.entity IN (".getEntity('product').")"; if ($search_entity) $sql.= natural_search("entity",$search_entity); if ($search_product) $sql.= natural_search("p.ref",$search_product);