Fix fatal error and missing param

This commit is contained in:
John BOTELLA 2022-05-20 22:05:13 +02:00
parent fb74bbc204
commit b081649907

View File

@ -653,7 +653,7 @@ class FormSetupItem
public function saveConfValue() public function saveConfValue()
{ {
if (!empty($this->saveCallBack) && is_callable($this->saveCallBack)) { if (!empty($this->saveCallBack) && is_callable($this->saveCallBack)) {
return call_user_func($this->saveCallBack); return call_user_func($this->saveCallBack, $this);
} }
// Modify constant only if key was posted (avoid resetting key to the null value) // Modify constant only if key was posted (avoid resetting key to the null value)
@ -1013,6 +1013,7 @@ class FormSetupItem
} }
$out.= $this->langs->trans($template->label); $out.= $this->langs->trans($template->label);
} elseif (preg_match('/category:/', $this->type)) { } elseif (preg_match('/category:/', $this->type)) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$c = new Categorie($this->db); $c = new Categorie($this->db);
$result = $c->fetch($this->fieldValue); $result = $c->fetch($this->fieldValue);
if ($result < 0) { if ($result < 0) {