Fix bug when using direct link with custom pages - refs CT#7371

OK, but always try to add a comment to the code. In this case I will do it myself, but something like this would have been nice: "// Specifiy course ID as the current context does not hold a global $_course array"