diff --git a/inc/ticket.class.php b/inc/ticket.class.php index 06483211ac7..8ff405fb43a 100644 --- a/inc/ticket.class.php +++ b/inc/ticket.class.php @@ -6288,11 +6288,18 @@ function showTimeline($rand) { $options = array( 'parent' => $this, 'rand' => $rand ) ; - $obj = new $item['type'] ; - $obj->fields = $item['item'] ; - Plugin::doHook('pre_show_item', array('item' => $obj, 'options' => &$options)); + if( $obj = getItemForItemtype($item['type']) ){ + $obj->fields = $item['item'] ; + } else { + $obj = $item ; + } + Plugin::doHook('pre_show_item', array('item' => &$obj, 'options' => &$options)); - $item_i = $obj->fields; + if( is_array( $obj ) ){ + $item_i = $obj['item']; + } else { + $item_i = $obj->fields; + } $date = ""; if (isset($item_i['date'])) {