From 78842f56a3be7f4e63e426665edd85dd135f1b97 Mon Sep 17 00:00:00 2001 From: GregM Date: Tue, 7 Mar 2023 15:27:37 +0100 Subject: [PATCH 1/4] fix invalid argument for foreach --- htdocs/core/class/commonobject.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5f0741b26d4..cb3af5db5e3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6090,13 +6090,15 @@ abstract class CommonObject // If field is a computed field, value must become result of compute (regardless of whether a row exists // in the element's extrafields table) - foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { - //var_dump($conf->disable_compute); - if (empty($conf->disable_compute)) { - global $objectoffield; // We set a global variable to $objectoffield so - $objectoffield = $this; // we can use it inside computed formula - $this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); + if (is_array($extrafields->attributes[$this->table_element]['label'])){ + foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$this->table_element]) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) { + //var_dump($conf->disable_compute); + if (empty($conf->disable_compute)) { + global $objectoffield; // We set a global variable to $objectoffield so + $objectoffield = $this; // we can use it inside computed formula + $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, ''); + } } } } From 4291560577cc393a11243362c5a0c75d7b370b15 Mon Sep 17 00:00:00 2001 From: jpb Date: Tue, 7 Mar 2023 17:36:40 +0100 Subject: [PATCH 2/4] fix search_project_user --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 15fc35f9e84..f5c25f6a516 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -839,7 +839,7 @@ if ($search_project_user > 0) { $param .= '&search_project_user='.urlencode($search_project_user); } if ($search_project_contact != '') { - $param .= '&search_project_user='.urlencode($search_project_contact); + $param .= '&search_project_contact='.urlencode($search_project_contact); } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); From 3fbb744d55fc1c10935f6e513f2ee957d39ab503 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:21:19 +0100 Subject: [PATCH 3/4] FIX: holiday counter massaction: ErrorBadValueForParamNotAString and PHP 8 warning when no approval user right --- htdocs/holiday/define_holiday.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 2d47467319d..c19defa8ba3 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -363,6 +363,7 @@ if (count($typeleaves) == 0) { print_liste_field_titre((empty($user->rights->holiday->define_holiday) ? '' : 'Note'), $_SERVER["PHP_SELF"]); print_liste_field_titre(''); + $selectedfields = ''; if ($massactionbutton) { $selectedfields = $form->showCheckAddButtons('checkforselect', 1); } From 49d79a4c7c737e0d05163a4ee6b5f6bddfb74d80 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:48:38 +0100 Subject: [PATCH 4/4] FIX: installation superadmin creation: PHP 8 warning --- htdocs/core/lib/security.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index d1d0d7ed7d0..5a610090be2 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -257,7 +257,7 @@ function dol_verifyHash($chain, $hash, $type = '0') global $conf; if ($type == '0' && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_verify')) { - if ($hash[0] == '$') { + if (! empty($hash[0]) && $hash[0] == '$') { return password_verify($chain, $hash); } elseif (strlen($hash) == 32) { return dol_verifyHash($chain, $hash, '3'); // md5