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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7.1
    • Fix Version/s: 3.6.6, 3.7.2
    • Component/s: Course
    • Labels:
    • Testing Instructions:
      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)
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-66391-master

      Description

      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]

        Attachments

        1. screenshot-1.png
          177 kB
          Janelle Barcega

          Activity

            People

            Assignee:
            segunbabalola Segun Babalola
            Reporter:
            segunbabalola Segun Babalola
            Peer reviewer:
            Víctor Déniz Falcón Víctor Déniz Falcón
            Integrator:
            Andrew Lyons Andrew Lyons
            Tester:
            Janelle Barcega Janelle Barcega
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              9/Sep/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 25 minutes
                1h 25m