diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5f8a6049a7f..d40406beb09 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2361,15 +2361,12 @@ abstract class CommonObject } else { $result = $this->fetchCommon($id); } - if (property_exists($this, $field)) { // Set again the property field because it may have been erased by the previous fetch - $this->$field = $value; - } - if ($propfield != $field && property_exists($this, $propfield)) { // Set again the property field because it may have been erased by the previous fetch - $this->$propfield = $value; - } $this->oldcopy = clone $this; - if (property_exists($this->oldcopy, $propfield)) { + if (property_exists($this->oldcopy, $field)) { + $this->oldcopy->$field = $oldvalue; + } + if ($propfield != $field && property_exists($this->oldcopy, $propfield)) { $this->oldcopy->$propfield = $oldvalue; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index b2085b6dc97..8c13c6db0bf 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -2305,7 +2305,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['p.tosell']['checked'])) { print '