From 1b7d54b3acfe023488f8870fd48f1d5b281839b0 Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Tue, 27 Aug 2024 17:35:30 +0200 Subject: [PATCH 1/2] fix php8 err --- htdocs/commande/list.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9211cddf045e4..07db31d2e499b 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2272,7 +2272,7 @@ if (empty($typenArray)) { $typenArray = $formcompany->typent_array(1); } - print $typenArray[$obj->typent_code]; + print $typenArray[$obj->typent_code]??''; print ''; if (!$i) { $totalarray['nbfield']++; @@ -2516,6 +2516,7 @@ // Total margin if (!empty($arrayfields['total_margin']['checked'])) { + print ''.price($marginInfo['total_margin']).''; if (!$i) { $totalarray['nbfield']++; @@ -2523,6 +2524,12 @@ 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']; } From b0d766a42bfc42bb26b8b91d4ce237a49e12613e Mon Sep 17 00:00:00 2001 From: John BOTELLA <68917336+thersane-john@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:32:46 +0200 Subject: [PATCH 2/2] Fix php 8 --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 762416d2ad8fd..3e2375b9078a4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8145,7 +8145,7 @@ public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showe $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 = '';