From 631be04d5de1c7489af970338d94163dc174d61e Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 27 Mar 2019 12:15:50 +0100 Subject: [PATCH] better clone oldline and avoid emptylabel on update --- htdocs/commande/class/commande.class.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6eff20da863..18495a68f50 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2195,9 +2195,7 @@ class Commande extends CommonOrder $line->fetch($lineid); // Memorize previous line for triggers - $staticline=new OrderLine($this->db); - $staticline->fetch($lineid); - $staticline->fetch_optionals($lineid); + $staticline = clone $line; $line->oldline = $staticline; if ($line->delete($user) > 0) @@ -3054,7 +3052,7 @@ class Commande extends CommonOrder } $this->line->rowid=$rowid; - $this->line->label=$label; + $this->line->label=!empty($label)?$label:$this->line->oldline->label; $this->line->desc=$desc; $this->line->qty=$qty;