From d4db4480d708bb1697dab8539aa0590735a0b07c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:15:15 +0200 Subject: [PATCH 1/2] FIX Warning php8 --- htdocs/compta/facture/tpl/linkedobjectblock.tpl.php | 4 ++-- .../mailings/thirdparties_services_expired.modules.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index 14bb45f0687..c70416fec6e 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -71,9 +71,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) { print ''.$objectlink->ref_client.''; print ''.dol_print_date($objectlink->date, 'day').''; print ''; - if ($user->rights->facture->lire) { + if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) { $sign = 1; - if ($object->type == Facture::TYPE_CREDIT_NOTE) { + if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) { $sign = -1; } if ($objectlink->statut != 3) { diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index b5dec9cbbe0..979782e61a5 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -217,7 +217,7 @@ class mailing_thirdparties_services_expired extends MailingTargets { global $langs; - $s .= ''; if (count($this->arrayofproducts)) { $s .= ''; } else { @@ -228,6 +228,7 @@ class mailing_thirdparties_services_expired extends MailingTargets } $s .= ''; $s .= ajax_combobox("filter_services_expired"); + return $s; } From c5c85fad9d80bcc9881c6f4e52ce2d7dcb8ecb01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 20 Sep 2022 11:18:10 +0200 Subject: [PATCH 2/2] Fix warning --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1b9b64ffb0f..04f1c6239be 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7988,7 +7988,7 @@ abstract class CommonObject switch ($mode) { case "view": - $value = $this->array_options["options_".$key.$keysuffix]; // Value may be clean or formated later + $value = ((!empty($this->array_options) && array_key_exists("options_".$key.$keysuffix, $this->array_options)) ? $this->array_options["options_".$key.$keysuffix] : null); // Value may be cleaned or formated later break; case "create": case "edit":