Moodle
  1. Moodle
  2. MDL-25974

Switching roles when course is hidden causes error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Create a course and make in unavailable to students. Add a quiz. Switch role to...Student. Try to open the quiz.

      Coding error detected, it must be fixed by a programmer: PHP catchable fatal error

      Debug mode gives this information:
      Debug info: Argument 1 passed to global_navigation::add_course_essentials() must be an instance of navigation_node, boolean given, called in /var/www/html/lib/navigationlib.php on line 1023 and defined
      Stack trace:
      •line 351 of /lib/setuplib.php: coding_exception thrown
      •line 1943 of /lib/navigationlib.php: call to default_error_handler()
      •line 1023 of /lib/navigationlib.php: call to global_navigation->add_course_essentials()
      •line 2339 of /lib/navigationlib.php: call to global_navigation->initialise()
      •line 641 of /lib/pagelib.php: call to navbar->has_items()
      •line 4 of /theme/formal_white/layout/general.php: call to moodle_page->has_navbar()
      •line 647 of /lib/outputrenderers.php: call to include()
      •line 605 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      •line ? of unknownfile: call to core_renderer->header()
      •line 1200 of /lib/setuplib.php: call to call_user_func_array()
      •line 83 of /mod/quiz/view.php: call to bootstrap_renderer->__call()
      •line 83 of /mod/quiz/view.php: call to bootstrap_renderer->header()

      This only happens when the course is hidden. If the course is available to students, switching roles works as expected.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Daren Chandisingh added a comment -

            The method above doesn't result in any errors for me [2.0.1+ (Build: 20110112)]. It may be related to specific quiz settings (I'm using defaults, apart from making it unavailable for students).

            Show
            Daren Chandisingh added a comment - The method above doesn't result in any errors for me [2.0.1+ (Build: 20110112)] . It may be related to specific quiz settings (I'm using defaults, apart from making it unavailable for students).
            Hide
            Gerard Thouvenin added a comment -

            Hello,

            Same problem, same error for me with Moodle 2.0.1+ (Build: 20110119). Impossible to access file, folder, assignment, test ... when taking student role in a hidden course.

            Gérard

            Show
            Gerard Thouvenin added a comment - Hello, Same problem, same error for me with Moodle 2.0.1+ (Build: 20110119). Impossible to access file, folder, assignment, test ... when taking student role in a hidden course. Gérard
            Hide
            Petr Skoda added a comment -

            Fix should be available in the next weekly build, thanks for the report.

            Petr

            Show
            Petr Skoda added a comment - Fix should be available in the next weekly build, thanks for the report. Petr

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: