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

navbar::ignore_active() shows debugging message

XMLWordPrintable

    • WP Sprint 2023-I3.2 (Atlantic)

      If I want to remove navbar on a page that has course category context, I need to call

      $PAGE->navbar->ignore_active(true);
      

      this shows debugging message:

      • Warning: Undefined variable $outcome in /.../lib/navigationlib.php on line 3672

      I'm not sure how to reproduce it in core, but I can do it on a custom page like this:

      require('../../../config.php');
       
      require_login();
       
      $url = new moodle_url('/admin/tool/sitenavdemo/x.php', []);
      $PAGE->set_url($url);
      $catid = core_course_category::top()->get_all_children_ids()[0];
      $PAGE->set_context(context_coursecat::instance($catid));
       
      $PAGE->navbar->ignore_active(true);
      $PAGE->set_heading($SITE->fullname);
      echo $OUTPUT->header();
      echo $OUTPUT->footer();
      

      In order to reproduce in core, you can just add

      $PAGE->navbar->ignore_active(true);
      

      anywhere in the course/index.php and open it for any category

            marina Marina Glancy
            marina Marina Glancy
            Mohamed Shehata Mohamed Shehata
            Paul Holden Paul Holden
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 6 minutes
                3h 6m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.