From 509819c1191293c0fbc88097d6825ac3cbbaf72a Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Wed, 21 Oct 2020 23:19:29 +0200 Subject: [PATCH 1/2] FIX 12.0 - third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order) --- htdocs/core/tpl/card_presend.tpl.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 24fcaa62afa..479b4b694aa 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -180,6 +180,9 @@ if ($action == 'presend') } else { + if (!empty($object->socid) && empty($object->thirdparty)) { + $object->fetch_thirdparty(); + } if (is_object($object->thirdparty)) { foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key => $value) { From 56db7d6c647f5c0b4708977ab3592c1e4d791b66 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Thu, 22 Oct 2020 15:09:48 +0200 Subject: [PATCH 2/2] FIX: also check if there is a method $object->fetch_thirdparty() before calling it --- htdocs/core/tpl/card_presend.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 479b4b694aa..d9097ee0919 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -180,7 +180,7 @@ if ($action == 'presend') } else { - if (!empty($object->socid) && empty($object->thirdparty)) { + if (!empty($object->socid) && empty($object->thirdparty) && method_exists($object, 'fetch_thirdparty')) { $object->fetch_thirdparty(); } if (is_object($object->thirdparty))