method_exists skip fatal error
This commit is contained in:
parent
cef9cf8670
commit
006dc787c1
@ -8778,8 +8778,10 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
|
|||||||
dol_include_once($labeltemp[2]);
|
dol_include_once($labeltemp[2]);
|
||||||
$obj = new $labeltemp[1]($db);
|
$obj = new $labeltemp[1]($db);
|
||||||
$function = $labeltemp[3];
|
$function = $labeltemp[3];
|
||||||
$nbrec = $obj->$function($object->id, $obj);
|
if (method_exists($obj, $function)) {
|
||||||
$label .= '<span class="badge marginleftonlyshort">'.$nbrec.'</span>';
|
$nbrec = $obj->$function($object->id, $obj);
|
||||||
|
$label .= '<span class="badge marginleftonlyshort">'.$nbrec.'</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$label = $langs->trans($values[2]);
|
$label = $langs->trans($values[2]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user