Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34250

Error shown when logging in as a user into a course in a hidden category

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3.1, 2.4
    • 2.3.2
    • Navigation
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MOODLE_23_STABLE
    • MDL-34250_M24
    • Hide

      Be sure that 'navshowmycoursecategories' is set to 'Yes'

      As Administrator:
      1. Set Miscellaneous to NOT show (grayed out)
      2. Within Miscellaneous create a cours i.e. Test123 (visible, not-grayed out)
      3. Course full name test123 and Course short name test123
      4. Enrol the administrator in this new course.

      Verify that the navigation block is rendered correctly

      Also try enrolling a student into the test123 coure, and verify that when logging in as a student the navigation block is built correctly.

      Show
      Be sure that 'navshowmycoursecategories' is set to 'Yes' As Administrator: 1. Set Miscellaneous to NOT show (grayed out) 2. Within Miscellaneous create a cours i.e. Test123 (visible, not-grayed out) 3. Course full name test123 and Course short name test123 4. Enrol the administrator in this new course. Verify that the navigation block is rendered correctly Also try enrolling a student into the test123 coure, and verify that when logging in as a student the navigation block is built correctly.

    Description

      Upgrade to 2.3.1 - (similar issue with 2.3 upgrade) - 'navshowmycoursecategories' set to 'Yes'

      Fatal error generated when logging on as a user enrolled on a course located within a 'hidden' top level category (ie category where parent = 0) - error also generated if user is enrolled on a course within a 'viewable' sub-catagory within a 'hidden' top-level category. No error generated if user enrolled on a course within a 'hidden' sub-category where the relevant top level category is 'viewable'.

      Debug error message:

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error 
      Debug info: Argument 2 passed to has_capability() must be an instance of context, boolean given, called in \lib\navigationlib.php on line 1134 and defined
       
      Error code: codingerror
       
      Stack trace: 
      line 397 of \lib\setuplib.php: coding_exception thrown
      line 355 of \lib\accesslib.php: call to default_error_handler()
      line 1134 of \lib\navigationlib.php: call to has_capability()
      line 3036 of \lib\navigationlib.php: call to global_navigation->initialise()
      line 778 of \lib\pagelib.php: call to navbar->has_items()
      line 4 of \theme\afterburner\layout\default.php: call to moodle_page->has_navbar()
      line 765 of \lib\outputrenderers.php: call to include()
      line 712 of \lib\outputrenderers.php: call to core_renderer->render_page_layout()
      line ? of unknownfile: call to core_renderer->header()
      line 1416 of \lib\setuplib.php: call to call_user_func_array()
      line 98 of \index.php: call to bootstrap_renderer->__call()
      line 98 of \index.php: call to bootstrap_renderer->header() 

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              kennyro Kenny Robb
              David Monllaó David Monllaó
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Andrew Davis Andrew Davis
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Sep/12