diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 96f4b820190..c581de29ee9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2282,6 +2282,9 @@ abstract class CommonObject if ($objecttype == 'member') { $classpath = 'adherents/class'; $module='adherent'; $subelement='adherent'; } + if ($objecttype == 'cabinetmed_cons') { + $classpath = 'cabinetmed/class'; $module='cabinetmed'; $subelement='cabinetmedcons'; + } //print "objecttype=".$objecttype." module=".$module." subelement=".$subelement; @@ -2293,13 +2296,15 @@ abstract class CommonObject $classfile = 'fournisseur.commande'; $classname='CommandeFournisseur'; } - if ($conf->$module->enabled) + if (! empty($conf->$module->enabled)) { - dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); - - $object = new $classname($this->db); - $ret=$object->fetch($objectid); - if ($ret > 0) return $object->getNomUrl($withpicto,$option); + $res=dol_include_once('/'.$classpath.'/'.$classfile.'.class.php'); + if ($res) + { + $object = new $classname($this->db); + $ret=$object->fetch($objectid); + if ($ret > 0) return $object->getNomUrl($withpicto,$option); + } } }