From ff8a8f5bb4d29f57bb23c07413aa17e88fb5554d Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 5 Jan 2026 14:39:42 +0100 Subject: [PATCH] Fix : presend on reception resulted in fatal error (#36794) --- htdocs/core/tpl/card_presend.tpl.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index f467c0899dc..bbee47a8265 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -333,6 +333,13 @@ if ($action == 'presend') { if (!empty($origin) && !empty($origin_id)) { $element = $subelement = $origin; + + if ($element == 'order_supplier') { + $element = 'fourn'; + $subelement = 'fournisseur.commande'; + $origin = 'CommandeFournisseur'; + } + $regs = array(); if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { $element = $regs[1]; @@ -355,10 +362,6 @@ if ($action == 'presend') { if ($element == 'shipping') { $element = $subelement = 'expedition'; } - if ($element == 'order_supplier') { - $element = 'fourn'; - $subelement = 'fournisseur.commande'; - } if ($element == 'project') { $element = 'projet'; }