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

Incorrect link in breadcrumb when you are enrolled in courses > navcourselimit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.7, 3.5.4, 3.6.2
    • Fix Version/s: None
    • Component/s: Navigation
    • Labels:
      None
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE

      Description

      When a user is enrolled in more courses than $CFG->navcourselimit, some of those courses will display 'Courses' (linking to /course/index.php) instead of 'My Courses'

      To replicate:
      Be logged in as a user who is enrolled in more courses that the navcourselimit. Navigate to the user's profile.
      All the courses that display initially will work as expected, but all of the courses revealed by clicking the 'View More' link will display the error.

      I tracked the issue through the source code, and it seems to be an issue between these methods in /lib/navigationlib.php:
      global_navigation::initialise
      global_navigation::load_courses_enrolled
      global_navigation::add_course

      Initialise calls load_courses_enrolled first, and then add_course second for the course page we are currently in. The fundamental issue is that add_course assumes that all courses that belong in mycourses must have allready been loaded into rootnodes['mycourses'] by load_courses_enrolled.

      One simple fix would be to not assume that rootnode['mycourses'] does not have every course you are enrolled in and just check.

      Example solution:
      https://github.com/frederickOtus/moodle/commit/6eeb35ba189e5ccd9a927e0d72d76e4c5729e63c

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            peterm9 Peter Miller
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: