From d5afa1b29f040349eb1b27382ee0e8fa5be4d4d3 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 18 Mar 2015 13:23:14 +0100 Subject: [PATCH] Update extrafields.class.php Link object : include only if something to display --- htdocs/core/class/extrafields.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 361c14319eb..a1ac0d5b6e3 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1054,6 +1054,7 @@ class ExtraFields elseif ($type == 'link') { $out=''; + $param_list=array_keys($param['options']); // 0 : ObjectName // 1 : classPath @@ -1292,14 +1293,15 @@ class ExtraFields elseif ($type == 'link') { $out=''; - $param_list=array_keys($params['options']); - // 0 : ObjectName - // 1 : classPath - $InfoFieldList = explode(":", $param_list[0]); - dol_include_once($InfoFieldList[1]); - $object = new $InfoFieldList[0]($this->db); + // only if something to display (perf) if ($value) { + $param_list=array_keys($params['options']); + // 0 : ObjectName + // 1 : classPath + $InfoFieldList = explode(":", $param_list[0]); + dol_include_once($InfoFieldList[1]); + $object = new $InfoFieldList[0]($this->db); $object->fetch($value); $value=$object->getNomUrl(3); }