I found out that the problem was in the plugin 'Archiver'. I added a row with 'Signal::send('ticket.before.delete', $this); // Archiver plugin: Added to archive tickets before deleting them. to the 'class.ticket.php' file.
After restoring the original file it works again.
Seems that I did something wrong?
I had the folowing:
function delete($comments='') {
global $ost, $thisstaff;
Signal::send('ticket.before.delete', $this); // Archiver plugin: Added to archive tickets before deleting them.
//delete just orphaned ticket thread & associated attachments.
// Fetch thread prior to removing ticket entry
$t = $this->getThread();