FIX: extrafields of type "int" not displayed on projet/tasks.php (#34896)
+ fix warning "Undefined variable $object"
This commit is contained in:
parent
2c073b37c0
commit
0e7770dc71
1 changed files with 2 additions and 2 deletions
|
|
@ -56,7 +56,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
|||
}
|
||||
$value = $datenotinstring;
|
||||
} elseif (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('int'))) {
|
||||
$value = (!empty($obj->$tmpkey) || $obj->$tmpkey === '0' ? $obj->$tmpkey : '');
|
||||
$value = $obj->$tmpkey ?? (isset($obj->array_options[$tmpkey]) ? $obj->array_options[$tmpkey] : null) ?? '';
|
||||
} else {
|
||||
// The key may be in $obj->array_options if not in $obj
|
||||
$value = (isset($obj->$tmpkey) ? $obj->$tmpkey :
|
||||
|
|
@ -71,7 +71,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
|
|||
}
|
||||
}
|
||||
|
||||
$valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object);
|
||||
$valuetoshow = $extrafields->showOutputField($key, $value, '', $extrafieldsobjectkey, null, $object ?? null);
|
||||
$title = dol_string_nohtmltag($valuetoshow);
|
||||
|
||||
print '<td'.($cssclass ? ' class="'.$cssclass.'"' : ''); // TODO Add 'css' and 'cssview' and 'csslist' for extrafields and use here 'csslist'
|
||||
|
|
|
|||
Loading…
Reference in a new issue