From 251e0b1364a6a278632bb156cc39a2897e486828 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 11 Aug 2022 18:11:16 +0200 Subject: [PATCH 1/2] Fix dispatch - php warning on tmpproduct --- htdocs/fourn/commande/dispatch.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 7b352a01abc..8ce06bed05b 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1202,10 +1202,6 @@ if ($id > 0 || !empty($ref)) { while ($i < $num) { $objp = $db->fetch_object($resql); - $tmpproduct->id = $objp->fk_product; - $tmpproduct->ref = $objp->ref; - $tmpproduct->label = $objp->label; - if ($action == 'editline' && $lineid == $objp->dispatchlineid) { print '
@@ -1237,6 +1233,9 @@ if ($id > 0 || !empty($ref)) { } else { $tmpproduct = $conf->cache['product'][$objp->fk_product]; } + $tmpproduct->id = $objp->fk_product; + $tmpproduct->ref = $objp->ref; + $tmpproduct->label = $objp->label; print $tmpproduct->getNomUrl(1); print ' - '.$objp->label; print "\n"; From 4167cca0518baad19b85cda0fae048ac69d63592 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 11 Aug 2022 18:26:18 +0200 Subject: [PATCH 2/2] No need to set tmpproduct properties because fetched. --- htdocs/fourn/commande/dispatch.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 8ce06bed05b..e2ed6adfdbe 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -1233,9 +1233,6 @@ if ($id > 0 || !empty($ref)) { } else { $tmpproduct = $conf->cache['product'][$objp->fk_product]; } - $tmpproduct->id = $objp->fk_product; - $tmpproduct->ref = $objp->ref; - $tmpproduct->label = $objp->label; print $tmpproduct->getNomUrl(1); print ' - '.$objp->label; print "\n";