Ticket oldcopy: use dol_clone() instead of fetching; keep oldcopy up to date if the methods are called several times
This commit is contained in:
parent
e247ec162a
commit
d113cf3689
@ -870,9 +870,8 @@ class Ticket extends CommonObject
|
|||||||
global $conf, $langs, $hookmanager;
|
global $conf, $langs, $hookmanager;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (empty($this->oldcopy) && empty($notrigger)) {
|
if (empty($notrigger)) {
|
||||||
$this->oldcopy = new self($this->db);
|
$this->oldcopy = dol_clone($this, 1);
|
||||||
$this->oldcopy->fetch($this->id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean parameters
|
// Clean parameters
|
||||||
@ -1464,9 +1463,8 @@ class Ticket extends CommonObject
|
|||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if ($this->statut != self::STATUS_CANCELED) { // no closed
|
if ($this->statut != self::STATUS_CANCELED) { // no closed
|
||||||
if (empty($this->oldcopy) && empty($notrigger)) {
|
if (empty($notrigger)) {
|
||||||
$this->oldcopy = new self($this->db);
|
$this->oldcopy = dol_clone($this, 1);
|
||||||
$this->oldcopy->fetch($this->id);
|
|
||||||
}
|
}
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user