Merge pull request #21838 from frederic34/patch-4

fix php8 warning
This commit is contained in:
Laurent Destailleur 2022-08-22 22:18:31 +02:00 committed by GitHub
commit e469870e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
// we keep position for the first line
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
}
if (is_numeric($obj->$tmpkey)) {
if (isset($obj->$tmpkey) && is_numeric($obj->$tmpkey)) {
if (!isset($totalarray['totalizable'][$key]['total'])) {
$totalarray['totalizable'][$key]['total'] = 0;
}

View File

@ -3,7 +3,7 @@
if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable'])) {
foreach ($totalarray['totalizable'] as $keytotalizable => $valtotalizable) {
$totalarray['pos'][$valtotalizable['pos']] = $keytotalizable;
$totalarray['val'][$keytotalizable] = $valtotalizable['total'];
$totalarray['val'][$keytotalizable] = isset($valtotalizable['total']) ? $valtotalizable['total'] : 0;
}
}
// Show total line