From 079f6487fddf535e8dee5159349d0df7a8ccd313 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Sat, 31 Aug 2024 19:42:15 +0200 Subject: [PATCH] Fix : php 8 warnings v19.0 (#30799) * fix php8 err * Fix php 8 * fix missing precommit hooks * Update htdocs/commande/list.php * Update htdocs/commande/list.php --- htdocs/commande/list.php | 7 ++++++- htdocs/core/class/html.form.class.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9211cddf045..fbdcd8b1eb6 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2272,7 +2272,7 @@ while ($i < $imaxinloop) { if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } - print $typenArray[$obj->typent_code]; + print $typenArray[$obj->typent_code]??''; print ''; if (!$i) { $totalarray['nbfield']++; @@ -2523,6 +2523,11 @@ while ($i < $imaxinloop) { if (!$i) { $totalarray['pos'][$totalarray['nbfield']] = 'total_margin'; } + + if (!isset($totalarray['val']['total_margin'])) { + $totalarray['val']['total_margin'] = 0; + } + $totalarray['val']['total_margin'] += $marginInfo['total_margin']; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 762416d2ad8..3e2375b9078 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8145,7 +8145,7 @@ class Form $oldValueForShowOnCombobox = 0; foreach ($objecttmp->fields as $fieldK => $fielV) { - if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue; + if (!array_key_exists('showoncombobox', $fielV) || !$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue; if (!$oldValueForShowOnCombobox) { $selected_input_value = '';