fix php 8 warning

This commit is contained in:
Florian HENRY 2021-10-22 17:42:57 +02:00
parent 87ac58efb6
commit 3d8a5d745a

View File

@ -390,7 +390,11 @@ foreach ($search as $key => $val) {
} }
continue; continue;
} }
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); if (array_key_exists($key, $object->fields)) {
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
} else {
$mode_search = 0;
}
if ($search[$key] != '') { if ($search[$key] != '') {
$sql .= natural_search($key, $search[$key], $mode_search); $sql .= natural_search($key, $search[$key], $mode_search);
} }
@ -912,6 +916,7 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a
// -------------------------------------------------------------------- // --------------------------------------------------------------------
$i = 0; $i = 0;
$totalarray = array(); $totalarray = array();
$totalarray['nbfield']=0;
$cacheofoutputfield = array(); $cacheofoutputfield = array();
while ($i < min($num, $limit)) { while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
@ -946,15 +951,17 @@ while ($i < min($num, $limit)) {
} }
if (!empty($arrayfields['t.'.$key]['checked'])) { if (!empty($arrayfields['t.'.$key]['checked'])) {
print '<td'; print '<td';
if ($cssforfield || $val['css']) { if ($cssforfield || (array_key_exists('css', $val) && $val['css'])) {
print ' class="'; print ' class="';
} }
print $cssforfield; print $cssforfield;
if ($cssforfield && $val['css']) { if ($cssforfield && array_key_exists('css', $val) && $val['css']) {
print ' '; print ' ';
} }
print $val['css']; if (array_key_exists('css', $val)) {
if ($cssforfield || $val['css']) { print $val['css'];
}
if ($cssforfield || (array_key_exists('css', $val) && $val['css'])) {
print '"'; print '"';
} }
print '>'; print '>';