From a2a33f0ae9c8d8c1c584d5fbca876d9a9764be7a Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 13 Aug 2018 10:48:31 -0600 Subject: [PATCH] * Timesheet - Fix links to application custom fields are not created on first save --- timesheet/inc/class.timesheet_bo.inc.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/timesheet/inc/class.timesheet_bo.inc.php b/timesheet/inc/class.timesheet_bo.inc.php index 3273aa3d6a..d368cd4afb 100644 --- a/timesheet/inc/class.timesheet_bo.inc.php +++ b/timesheet/inc/class.timesheet_bo.inc.php @@ -647,18 +647,18 @@ class timesheet_bo extends Api\Storage Link::restore(TIMESHEET_APP, $new['ts_id']); } - if (!is_object($this->tracking)) - { - $this->tracking = new timesheet_tracking($this); - - $this->tracking->html_content_allow = true; - } - if ($this->tracking->track($this->data,$old,$this->user) === false) - { - return implode(', ',$this->tracking->errors); - } if (!($err = parent::save())) { + if (!is_object($this->tracking)) + { + $this->tracking = new timesheet_tracking($this); + + $this->tracking->html_content_allow = true; + } + if ($this->tracking->track($this->data,$old,$this->user) === false) + { + return implode(', ',$this->tracking->errors); + } // notify the link-class about the update, as other apps may be subscribt to it Link::notify_update(TIMESHEET_APP,$this->data['ts_id'],$this->data); }