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/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":
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 .= ' |