Hello everybody,
I started working with Moodle this week and I am with this access problem.
A student is receiving this error message when accessing http: //moodle.../my/:
Coding error detected and shouldnt be fixed by a programmer: Context does not belong to any course.
Debug in the message:
[Thu Jun 16 11:39:22.908123 2016] [:error] [pid 13888] [client 200.195.135.2:53045] Default exception handler: Erro de codifica\xc3\xa7\xc3\xa3o detectado e deve ser corrigido por um programador: Context does not belong to any course.
Debug: \nError code: codingerror\n* line 5721 of /lib/accesslib.php: coding_exception thrown\n* line 7338 of /lib/accesslib.php:
call to context->get_course_context()\n* line 42 of /blocks/porcentagem/block_porcentagem.php:
call to context_block->get_course_context()\n* line 288 of /blocks/moodleblock.class.php:
call to block_porcentagem->get_content()\n* line 230 of /blocks/moodleblock.class.php:
call to block_base->formatted_contents()\n* line 973 of /lib/blocklib.php:
call to block_base->get_content_for_output()\n* line 1025 of /lib/blocklib.php:
call to block_manager->create_block_contents()\n* line 473 of /lib/outputrenderers.php:
call to block_manager->ensure_content_created()\n* line 37 of /theme/essential/layout/includes/header.php:
call to core_renderer->standard_head_html()\n* line 28 of /theme/essential/layout/columns3.php:
call to require_once()\n* line 1015 of /lib/outputrenderers.php:
call to include()\n* line 945 of /lib/outputrenderers.php:
call to core_renderer->render_page_layout()\n* line 164 of /my/index.php:
echo $OUTPUT->header();
call to core_renderer->header()\n, referer: http://e-learning.univiasoft.com.br/portal/
This error is only happening with this user, the error occurs:
/**
* Is this context part of any course? If yes return course context.
*
* @param bool $strict true means throw exception if not found, false means return false if not found
* @return context_course context of the enclosing course, null if not found or exception
*/
public function get_course_context($strict = true) {
if ($strict) {
throw new coding_exception('Context does not belong to any course.');
} else {
return false;
}
}
I've compared the mdl_user the user table fields with problem and a user where the problem does not occur and the fields are all the same.
I appreciate the help and I apologize for the English.