* Timesheet - Fix links to application custom fields are not created on first save

This commit is contained in:
nathangray 2018-08-13 10:48:31 -06:00
parent 135382c668
commit faf692510a

View File

@ -647,6 +647,8 @@ class timesheet_bo extends Api\Storage
Link::restore(TIMESHEET_APP, $new['ts_id']); Link::restore(TIMESHEET_APP, $new['ts_id']);
} }
if (!($err = parent::save()))
{
if (!is_object($this->tracking)) if (!is_object($this->tracking))
{ {
$this->tracking = new timesheet_tracking($this); $this->tracking = new timesheet_tracking($this);
@ -657,8 +659,6 @@ class timesheet_bo extends Api\Storage
{ {
return implode(', ',$this->tracking->errors); return implode(', ',$this->tracking->errors);
} }
if (!($err = parent::save()))
{
// notify the link-class about the update, as other apps may be subscribt to it // 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); Link::notify_update(TIMESHEET_APP,$this->data['ts_id'],$this->data);
} }