From ebce799bdbeca86c8f364c5148122d4d2d37483e Mon Sep 17 00:00:00 2001 From: adamhocini <72007447+adamhocini@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:58:14 +0100 Subject: [PATCH 1/2] Correct linked_objects assignment for 'propal' #Wrong sourcetype 'commande' instead of 'propal' when creating recurring invoice template from invoice linked to proposal #37099 @defrance (#37112) * Correct linked_objects assignment for 'propal' @defrance Adam Hocini * Refactor linked objects assignment for proposals --------- Co-authored-by: Laurent Destailleur --- htdocs/compta/facture/card-rec.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 5e9bad062f8..101b69d8d68 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -301,8 +301,7 @@ if (empty($reshook)) { $object->linked_objects['commande'] = $orderid; } elseif (!empty($srcObject->linkedObjectsIds['propal'])) { $proposalid = reset($srcObject->linkedObjectsIds['propal']); - - $object->linked_objects['commande'] = $proposalid; + $object->linked_objects['propal'] = $proposalid; } } From 7cd3abb9f85a6e697f2f0df4c83e8df0afba183b Mon Sep 17 00:00:00 2001 From: DarmonNoah <152853486+DarmonNoah@users.noreply.github.com> Date: Sun, 8 Feb 2026 00:00:12 +0100 Subject: [PATCH 2/2] Fixed Bug : email sending test #36741 (#37107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed Bug : email sending test #36741 @defrance --> Issue fixed The problem was caused by initializing $result = 0 in core/actions_sendmails.inc.php. When sending a test email from Setup → Emails, there is no $object to fetch. As a result, $result remained 0 and the code incorrectly triggered ErrorFailedToReadObject. The fix consists in explicitly setting $result = 1 when no $object is provided (test email / generic email context). This correctly treats the absence of an object as a valid case and restores the ability to send test emails, while keeping $result properly initialized. Co-authored-by: Laurent Destailleur --- htdocs/core/actions_sendmails.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 665751ff28f..5dcdffd95eb 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -189,6 +189,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO } } else { $thirdparty = $mysoc; + $result = 1; // No object to fetch (e.g. Setup -> Emails -> send test email): consider OK } if ($result > 0) {