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

navbar::ignore_active() shows debugging message

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79232-401
    • MDL-79232-master
    • Hide
      1. Create at least two course categories
      2. Navigate to /course/index.php and switch to a course category
      3. Make sure you can see the current category in the navbar
      4. In course/index.php add a line somewhere in lines 62-72 (before you call output):

        $PAGE->navbar->ignore_active();
        

      5. Navigate to /course/index.php
      6. Switch to course category
      7. Make sure you no longer see navbar and also you don't see any PHP warnings
      Show
      Create at least two course categories Navigate to /course/index.php and switch to a course category Make sure you can see the current category in the navbar In course/index.php add a line somewhere in lines 62-72 (before you call output): $PAGE->navbar->ignore_active(); Navigate to /course/index.php Switch to course category Make sure you no longer see navbar and also you don't see any PHP warnings
    • 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.