Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Component/s: learn.moodle.net
    • Labels:
      None

      Description

      PHP catchable fatal error Debug:

      Argument 3 passed to global_navigation::load_activity() must be an instance of navigation_node, boolean given, called in

      [dirroot]/lib/navigationlib.php on line 1205 and defined

      Error code: codingerror

      • line 406 of /lib/setuplib.php: coding_exception thrown
      • line 2019 of /lib/navigationlib.php: call to default_error_handler()
      • line 1205 of /lib/navigationlib.php: call to global_navigation->load_activity()
      • line 2971 of /lib/navigationlib.php: call to global_navigation->initialise()
      • line 3014 of /lib/navigationlib.php: call to navbar->has_items()
      • line 36 of /theme/learnmoodle/js/google_analytics.php: call to navbar->get_items()
      • line 35 of /theme/learnmoodle/layout/embedded.php: call to include()
      • line 847 of /lib/outputrenderers.php: call to include()
      • line 777 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      • line 720 of /lib/outputrenderers.php: call to core_renderer->header()
      • line ? of unknownfile: call to core_renderer->redirect_message()
      • line 1479 of /lib/setuplib.php: call to call_user_func_array()
      • line 2557 of /lib/weblib.php: call to bootstrap_renderer->__call()
      • line 2557 of /lib/weblib.php: call to bootstrap_renderer->redirect_message()
      • line 3139 of /lib/moodlelib.php: call to redirect()
      • line 56 of /mod/quiz/view.php: call to require_login()

      A remarkably similar issue arose on research earlier today as well, when Martin asked me to look into the issue.
      From what I could ascertain there, it appeared to only be presenting an issue when the user did not have access to a section as part of the navigation menu drawing (ie: i was able to recreate the issue on my user account, but not on my admin account).

      Martin believed that it was a bug in the database module, which seems to be valid, it looks like the google analytics stuff has simply called the same functions, which are rendering the same fatal errors.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            David Mudrak added a comment -

            This is not a module related problem. It's core thing. When access to an activity is restricted (as in "section hidden until" in our case) and the user visits the activity page via direct URL, then call to $PAGE->navbar->get_items() in our GA script (or any other place that does the same thing) throws exception because the activity cannot be loaded.

            My patch is here: https://github.com/moodlehq/learnmoodlenet/commit/558a0bdbf52b6db848888c2045d7066f73accd59

            Now when a normal enrolled user tries to open an activity an access to which is restricted (such as Week 1 activities), just a notice "Sorry, this activity is currently hidden" is displayed as expected.

            This should be probably fixed upstream too, even though the exact steps to reproduce this might be tricky (and depending on installed theme, for example).

            Show
            David Mudrak added a comment - This is not a module related problem. It's core thing. When access to an activity is restricted (as in "section hidden until" in our case) and the user visits the activity page via direct URL, then call to $PAGE->navbar->get_items() in our GA script (or any other place that does the same thing) throws exception because the activity cannot be loaded. My patch is here: https://github.com/moodlehq/learnmoodlenet/commit/558a0bdbf52b6db848888c2045d7066f73accd59 Now when a normal enrolled user tries to open an activity an access to which is restricted (such as Week 1 activities), just a notice "Sorry, this activity is currently hidden" is displayed as expected. This should be probably fixed upstream too, even though the exact steps to reproduce this might be tricky (and depending on installed theme, for example).
            Hide
            Marina Glancy added a comment -

            I wonder why was this issue reported under MDLSITE and not MDL. Linking to existing MDL-40191

            Show
            Marina Glancy added a comment - I wonder why was this issue reported under MDLSITE and not MDL. Linking to existing MDL-40191

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development