There are lots of fatal errors caused by pages that don't set context properly before strings etc try to use context:
"Coding error detected, it must be fixed by a programmer: $PAGE->context accessed before it was known."
Sam put in a fix some months ago to avoid this, by defaulting to SYSTEM context in these cases, which avoided the problem. Petr reverted citing security issues.
Currently this is breaking Moodle, so we need to fix it.