fixes #6652, #6578, #6738 - Enables setting auto-attach and triggers auto-attach and shows service level, BZ 1113879, BZ 1019227, BZ 999122

Also, if you put the cp_type line (line 358) after this code, it causes the problem again.