Login Page Error - moodle 3.7

Issue #40 new
Former user created an issue

Moodle configured with active forcelogin returns the following error:

You don't have permission to view courses here. Debug info: Error code: cannotviewcategory Stack trace: line 263 of \ course \ classes \ category.php: moodle_exception thrown line 202 of \ theme \ enlightlite \ renderers \ course_renderer.php: call to core_course_category :: get () line 136 of \ theme \ enlightlite \ renderers \ core_renderer.php: call to theme_enlightlite_core_course_renderer-> top_course_menu () line 85 of \ theme \ enlightlite \ renderers \ core_renderer.php: call to theme_enlightlite_core_renderer-> course_menu () line 44 of \ theme \ enlightlite \ renderers \ core_renderer.php: call to theme_enlightlite_core_renderer-> custom_menu_render () line 46 of \ theme \ enlightlite \ classes \ header_block.php: call to theme_enlightlite_core_renderer-> primarymenu () line 89 of \ theme \ enlightlite \ classes \ header_block.php: call to header_contents () line 28 of \ theme \ enlightlite \ layout \ login.php: call to require_once () line 1370 of \ lib \ outputrenderers.php: call to include () line 1300 of \ lib \ outputrenderers.php: call to core_renderer-> render_page_layout () line 1961 of \ lib \ setuplib.php: call to core_renderer-> header () line 355 of \ login \ index.php: call to bootstrap_renderer -> __ call ()

No pages are accessible.

Disabling forcelogin will work again.

Comments (2)

  1. Leon Stringer

    This seems to occur when course categories are only visible to users in specific roles. The theme doesn't handle this and tries to list all categories resulting in the cannotviewcategory error for categories the user is not allowed to view.

    I’ve created a pull request for this but I think the line terminator has been changed resulting in every line being shown as changed.

    Apologies if I’ve done this wrong please reject the pull request I can try to submit it again with the correct line terminators.

  2. Log in to comment