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

Ajax call for "Most recently accessed courses" is missing userid parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.6.6, 3.7.2
    • 3.7.1
    • Course
    • MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66391-master
    • Hide
      1. Open the browser dev tools
      2. Open the "Network" tab (or similar) in your browser
      3. Login to your site
      4. Ensure that you are on the "Dashboard"
      5. In the Network tab find the call for "core_course_get_recent_courses"
      6. Look at the Request payload
        1. Confirm that there is a userid argument
        2. Confirm that the userid matches the ID of the logged in user (You can find this in the Profile page in the URL)
      Show
      Open the browser dev tools Open the "Network" tab (or similar) in your browser Login to your site Ensure that you are on the "Dashboard" In the Network tab find the call for " core_course_get_recent_courses " Look at the Request payload Confirm that there is a userid argument Confirm that the userid matches the ID of the logged in user (You can find this in the Profile page in the URL)

      The JS function getLastAccessedCourses() in course/amd/repository.js (and its minified equivalent) are missing the userid parameter when ajax requests are sent to the get_recent_courses() function in course/externallib.php. We noticed this while investigating the cause of users sometimes being intermittently (and seemingly randomly) getting logged out of Moodle.

       

      You should be able to test this fix by looking at whether the call to this web-service was successful or not

      [https://[your.moodle.url]/lib/ajax/service.php?sesskey=[INSERT-YOUR-SESSKEY-HERE]&info=core_course_get_recent_courses|https://your.moodle.org/lib/ajax/service.php?sesskey=XYZABC123&info=core_course_get_enrolled_courses_by_timeline_classification]

            segunbabalola Segun Babalola
            segunbabalola Segun Babalola
            Victor Déniz Falcón Victor Déniz Falcón
            Andrew Lyons Andrew Lyons
            Janelle Barcega Janelle Barcega
            Votes:
            1 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 - 1 hour, 25 minutes
                1h 25m

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