diff --git a/core/components/tickets/model/tickets/ticket.class.php b/core/components/tickets/model/tickets/ticket.class.php index b672b873..0c2b5dde 100644 --- a/core/components/tickets/model/tickets/ticket.class.php +++ b/core/components/tickets/model/tickets/ticket.class.php @@ -321,8 +321,10 @@ protected function _getVirtualFields() 'id' => $this->id, 'class' => 'Ticket', ), '', true, true); - $total->fetchValues(); - $total->save(); + if ($total->save()) { + $total->fetchValues(); + $total->save(); + } } return $total->get(array( diff --git a/core/components/tickets/model/tickets/ticketssection.class.php b/core/components/tickets/model/tickets/ticketssection.class.php index 18c7bd5e..37f6e869 100644 --- a/core/components/tickets/model/tickets/ticketssection.class.php +++ b/core/components/tickets/model/tickets/ticketssection.class.php @@ -231,8 +231,10 @@ protected function _getVirtualFields() 'id' => $this->id, 'class' => 'TicketsSection', ), '', true, true); - $total->fetchValues(); - $total->save(); + if ($total->save()) { + $total->fetchValues(); + $total->save(); + } } return $total->get(array( diff --git a/core/components/tickets/model/tickets/tickettotal.class.php b/core/components/tickets/model/tickets/tickettotal.class.php index 2bec1cd6..aae7d271 100644 --- a/core/components/tickets/model/tickets/tickettotal.class.php +++ b/core/components/tickets/model/tickets/tickettotal.class.php @@ -2,21 +2,6 @@ class TicketTotal extends xPDOObject { - /** - * @param null $cacheFlag - * - * @return bool - */ - public function save($cacheFlag = null) - { - if ($this->isNew()) { - $this->fromArray($this->fetchValues(), '', false, true); - } - - return parent::save($cacheFlag); - } - - /** * Get values from database */