From c75fbb7642301873c99a23b2e8f2ccc24f646d5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2021 15:59:39 +0200 Subject: [PATCH] FIX fetch of product with modulebuilder load too much data --- htdocs/core/class/commonobject.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 24ac8762b99..1f0edd23401 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7296,7 +7296,11 @@ abstract class CommonObject dol_include_once($InfoFieldList[1]); if ($classname && class_exists($classname)) { $object = new $classname($this->db); - $object->fetch($value); + if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong + $object->fetch($value, '', '', '', 0, 1, 1); + } else { + $object->fetch($value); + } $value = $object->getNomUrl($getnomurlparam, $getnomurlparam2); } } else {