Apparently my "Fix" breaks the ticket view for agents that are not in a team. So I made a fix for my fix.
I added a check for staff teams and only add the team filter when the agent actually is in a team.
My code in include\staff\tickets.inc.php on line 99 and following, now looks like this (my new code in blue, removed code in red):
case 'assigned':
$status='open';
$staffId=$thisstaff->getId();
$results_type=__('My Tickets');
// original filter
/*
$tickets->filter(Q:(array(
'staff_id'=>$thisstaff->getId(),
Q:(array('staff_id' => 0, 'team_id__gt' => 0)),
)));*/
// Default filter
$ticket_filter = array(
'staff_id'=>$thisstaff->getId(),
Q:(array('staff_id' => 0, 'team_id__gt' => 0)),
);
$staff_teams = $thisstaff->getTeams();
// Add lookup only for teams if agent is in one
if(!empty($staff_teams)){
$ticket_filter = $staff_teams;
}
// add filter back in
$tickets->filter(Q:($ticket_filter));
$queue_sort_options = array('updated', 'priority,updated',
'priority,created', 'priority,due', 'due', 'answered', 'number',
'hot');
break;