- Make sure debugging is on
- Enable async course backups
- Backup a course and run cron
- Download the resulting backup file
- Go to Site admin > Course > Restore
- Upload the backup and proceed to restore the course into a new course
- When you are asked to wait (when the async restore in being processed), you'll see a php notice:
Notice: Trying to get property 'id' of non-object
The notice comes from this line.
In this case, $context is system, and $course is null.
So, the 'return to course' button won't work (it doesn't).